trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dewr...@apache.org
Subject [incubator-trafficcontrol] 08/33: modifies ds request flow per feedback
Date Wed, 21 Feb 2018 18:27:24 GMT
This is an automated email from the ASF dual-hosted git repository.

dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit f44401566986137851b27154aecb8ef9d799ea88
Author: Jeremy Mitchell <mitchell852@gmail.com>
AuthorDate: Fri Jan 12 11:04:24 2018 -0700

    modifies ds request flow per feedback
---
 .../common/api/DeliveryServiceRequestService.js    |   3 +-
 .../app/src/common/api/DeliveryServiceService.js   |   4 +-
 .../modules/{table/_table.scss => form/_form.scss} |  12 +-
 .../FormDeliveryServiceController.js               |   8 +
 .../edit/FormEditDeliveryServiceController.js      |  10 +-
 .../form.deliveryService.DNS.tpl.html              |  16 +-
 .../form.deliveryService.HTTP.tpl.html             |  16 +-
 .../form.deliveryService.Steering.tpl.html         |  16 +-
 .../form.deliveryService.anyMap.tpl.html           |  16 +-
 .../new/FormNewDeliveryServiceController.js        |   8 +-
 .../app/src/common/modules/table/_table.scss       |   4 +
 .../TableDeliveryServiceRequestsController.js      | 197 +++++++++++++++++++--
 .../table.deliveryServiceRequests.tpl.html         |  19 +-
 .../table.deliveryServices.tpl.html                |   2 +-
 .../FormEditDeliveryServiceRequestController.js    |  96 ++++++++--
 .../private/deliveryServiceRequests/edit/index.js  |   2 +-
 traffic_portal/app/src/styles/main.scss            |   1 +
 17 files changed, 326 insertions(+), 104 deletions(-)

diff --git a/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js b/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js
index 4d79152..43408f8 100644
--- a/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js
+++ b/traffic_portal/app/src/common/api/DeliveryServiceRequestService.js
@@ -27,7 +27,7 @@ var DeliveryServiceRequestService = function(Restangular, $http, $q, locationUti
 		return Restangular.service('deliveryservice_requests').post(dsRequest)
 			.then(
 				function() {
-					messageModel.setMessages([ { level: 'success', text: 'Delivery service request created'
} ], true);
+					messageModel.setMessages([ { level: 'success', text: 'Created request to ' + dsRequest.changeType
+ ' the ' + dsRequest.request.xmlId + ' delivery service' } ], true);
 					locationUtils.navigateToPath('/delivery-service-requests');
 				},
 				function(fault) {
@@ -42,7 +42,6 @@ var DeliveryServiceRequestService = function(Restangular, $http, $q, locationUti
 		$http.put(ENV.api['root'] + "deliveryservice_requests/" + id, dsRequest)
 			.then(
 				function() {
-					messageModel.setMessages([ { level: 'success', text: 'Delivery service request updated'
} ], false);
 					request.resolve();
 				},
 				function(fault) {
diff --git a/traffic_portal/app/src/common/api/DeliveryServiceService.js b/traffic_portal/app/src/common/api/DeliveryServiceService.js
index a760544..6620813 100644
--- a/traffic_portal/app/src/common/api/DeliveryServiceService.js
+++ b/traffic_portal/app/src/common/api/DeliveryServiceService.js
@@ -40,14 +40,14 @@ var DeliveryServiceService = function(Restangular, $http, $q, locationUtils,
htt
             );
     };
 
-    this.updateDeliveryService = function(ds) {
+    this.updateDeliveryService = function(ds, delay) {
         var request = $q.defer();
 
         $http.put(ENV.api['root'] + "deliveryservices/" + ds.id, ds)
             .then(
                 function(response) {
                     var response2 = response.data.response[0];
-                    messageModel.setMessages([ { level: 'success', text: 'Delivery Service
[ ' + ds.xmlId + ' ] updated' } ], false);
+                    messageModel.setMessages([ { level: 'success', text: 'Delivery Service
[ ' + ds.xmlId + ' ] updated' } ], delay);
                     locationUtils.navigateToPath('/delivery-services/' + response2.id + '?type='
+ response2.type);
                 },
                 function(fault) {
diff --git a/traffic_portal/app/src/common/modules/table/_table.scss b/traffic_portal/app/src/common/modules/form/_form.scss
similarity index 82%
copy from traffic_portal/app/src/common/modules/table/_table.scss
copy to traffic_portal/app/src/common/modules/form/_form.scss
index 7449d60..a35b3c5 100644
--- a/traffic_portal/app/src/common/modules/table/_table.scss
+++ b/traffic_portal/app/src/common/modules/form/_form.scss
@@ -15,13 +15,7 @@
 
 */
 
-.update-column {
-  text-align: center;
-  .fa-flag {
-    font-weight: bold;
-  }
-}
-
-.action-link {
-  padding: 5px;
+.btn-link.request-status {
+  font-size: 20px;
+  color: #cd1323;
 }
\ No newline at end of file
diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
index ad2f6ea..f41f766 100644
--- a/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
+++ b/traffic_portal/app/src/common/modules/form/deliveryService/FormDeliveryServiceController.js
@@ -69,6 +69,14 @@ var FormDeliveryServiceController = function(deliveryService, type, types,
$scop
     $scope.PENDING = 3;
     $scope.COMPLETE = 4;
 
+    $scope.saveable = function() {
+        return true;
+    };
+
+    $scope.deletable = function() {
+        return true;
+    };
+
     $scope.types = _.filter(types, function(currentType) {
         var category;
         if (type.indexOf('ANY_MAP') != -1) {
diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/edit/FormEditDeliveryServiceController.js
b/traffic_portal/app/src/common/modules/form/deliveryService/edit/FormEditDeliveryServiceController.js
index 265927a..90309f1 100644
--- a/traffic_portal/app/src/common/modules/form/deliveryService/edit/FormEditDeliveryServiceController.js
+++ b/traffic_portal/app/src/common/modules/form/deliveryService/edit/FormEditDeliveryServiceController.js
@@ -41,8 +41,8 @@ var FormEditDeliveryServiceController = function(deliveryService, type,
types, $
 	$scope.save = function(deliveryService) {
 		if ($scope.dsRequestsEnabled) {
 			var params = {
-				title: "Update Delivery Service",
-				message: 'All delivery service changes must be reviewed for completeness and accuracy
before deployment. A request will be created for you. Please select the status of your request.'
+				title: "Delivery Service Update Request",
+				message: 'All delivery service updates must be reviewed for completeness and accuracy
before deployment.<br><br>Please select the status of your delivery service update
request.'
 			};
 			var modalInstance = $uibModal.open({
 				templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
@@ -54,8 +54,8 @@ var FormEditDeliveryServiceController = function(deliveryService, type,
types, $
 					},
 					collection: function() {
 						return [
-							{ id: $scope.DRAFT, name: 'Save Request as Draft' },
-							{ id: $scope.SUBMITTED, name: 'Submit Request for Review / Deployment' }
+							{ id: $scope.DRAFT, name: 'Save as Draft' },
+							{ id: $scope.SUBMITTED, name: 'Submit for Review and Deployment' }
 						];
 					}
 				}
@@ -71,7 +71,7 @@ var FormEditDeliveryServiceController = function(deliveryService, type,
types, $
 				// do nothing
 			});
 		} else {
-			deliveryServiceService.updateDeliveryService(deliveryService).
+			deliveryServiceService.updateDeliveryService(deliveryService, false).
 				then(function() {
 					$state.reload(); // reloads all the resolves for the view
 				});
diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
index bed1524..aa75f9b 100644
--- a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
+++ b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.DNS.tpl.html
@@ -26,16 +26,7 @@ under the License.
             <li class="active">{{deliveryServiceName}}</li>
         </ol>
         <div class="pull-right" role="group" ng-if="settings.isRequest">
-            <button class="btn btn-primary" title="Fulfill Request" ng-click="fulfill(deliveryService)">Fulfill
Request</button>
-            <div ng-if="changeType == 'update'" class="btn-group" role="group" uib-dropdown
is-open="more.isopen">
-                <button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle
aria-haspopup="true" aria-expanded="false">
-                    More
-                    <span class="caret"></span>
-                </button>
-                <ul class="dropdown-menu-right dropdown-menu" uib-dropdown-menu>
-                    <li role="menuitem"><a ng-click="showDiff()">Show Delivery
Service Diff</a></li>
-                </ul>
-            </div>
+            <button class="btn btn-link request-status" title="Edit Status" ng-disabled="!statusEditable()"
ng-click="editStatus()">[ {{::requestStatus}} ]</button>
         </div>
         <div class="pull-right" role="group" ng-if="!settings.isRequest && !settings.isNew">
             <div class="btn-group" role="group" uib-dropdown is-open="keys.isopen">
@@ -500,8 +491,9 @@ under the License.
 
             <div class="modal-footer">
                 <button class="btn btn-link" ng-click="advancedShowing = !advancedShowing"><span
ng-show="!advancedShowing">Show</span><span ng-show="advancedShowing">Hide</span>
Advanced</button>
-                <button type="button" class="btn btn-danger" ng-show="!settings.isNew"
ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
-                <button type="button" class="btn btn-success" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-danger" ng-if="!settings.isNew &&
!fulfill" ng-disabled="!deletable()" ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="!fulfill" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid || !saveable()" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="settings.isRequest
&& fulfill" ng-disabled="deliveryServiceForm.$invalid" ng-click="fulfillRequest(deliveryService)">Fulfill
Request</button>
             </div>
         </form>
     </div>
diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
index b4ea4fb..a987ca8 100644
--- a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
+++ b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.HTTP.tpl.html
@@ -26,16 +26,7 @@ under the License.
             <li class="active">{{deliveryServiceName}}</li>
         </ol>
         <div class="pull-right" role="group" ng-if="settings.isRequest">
-            <button class="btn btn-primary" title="Fulfill Request" ng-click="fulfill(deliveryService)">Fulfill
Request</button>
-            <div ng-if="changeType == 'update'" class="btn-group" role="group" uib-dropdown
is-open="more.isopen">
-                <button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle
aria-haspopup="true" aria-expanded="false">
-                    More
-                    <span class="caret"></span>
-                </button>
-                <ul class="dropdown-menu-right dropdown-menu" uib-dropdown-menu>
-                    <li role="menuitem"><a ng-click="showDiff()">Show Delivery
Service Diff</a></li>
-                </ul>
-            </div>
+            <button class="btn btn-link request-status" title="Edit Status" ng-disabled="!statusEditable()"
ng-click="editStatus()">[ {{::requestStatus}} ]</button>
         </div>
         <div class="pull-right" role="group" ng-if="!settings.isRequest && !settings.isNew">
             <div class="btn-group" role="group" uib-dropdown is-open="keys.isopen">
@@ -503,8 +494,9 @@ under the License.
 
             <div class="modal-footer">
                 <button class="btn btn-link" ng-click="advancedShowing = !advancedShowing"><span
ng-show="!advancedShowing">Show</span><span ng-show="advancedShowing">Hide</span>
Advanced</button>
-                <button type="button" class="btn btn-danger" ng-show="!settings.isNew"
ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
-                <button type="button" class="btn btn-success" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-danger" ng-if="!settings.isNew &&
!fulfill" ng-disabled="!deletable()" ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="!fulfill" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid || !saveable()" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="settings.isRequest
&& fulfill" ng-disabled="deliveryServiceForm.$invalid" ng-click="fulfillRequest(deliveryService)">Fulfill
Request</button>
             </div>
         </form>
     </div>
diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
index 7b26465..36053af 100644
--- a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
+++ b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
@@ -26,16 +26,7 @@ under the License.
             <li class="active">{{deliveryServiceName}}</li>
         </ol>
         <div class="pull-right" role="group" ng-if="settings.isRequest">
-            <button class="btn btn-primary" title="Fulfill Request" ng-click="fulfill(deliveryService)">Fulfill
Request</button>
-            <div ng-if="changeType == 'update'" class="btn-group" role="group" uib-dropdown
is-open="more.isopen">
-                <button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle
aria-haspopup="true" aria-expanded="false">
-                    More
-                    <span class="caret"></span>
-                </button>
-                <ul class="dropdown-menu-right dropdown-menu" uib-dropdown-menu>
-                    <li role="menuitem"><a ng-click="showDiff()">Show Delivery
Service Diff</a></li>
-                </ul>
-            </div>
+            <button class="btn btn-link request-status" title="Edit Status" ng-disabled="!statusEditable()"
ng-click="editStatus()">[ {{::requestStatus}} ]</button>
         </div>
         <div class="pull-right" role="group" ng-if="!settings.isRequest && !settings.isNew">
             <div class="btn-group" role="group" uib-dropdown is-open="keys.isopen">
@@ -289,8 +280,9 @@ under the License.
 
             <div class="modal-footer">
                 <button class="btn btn-link" ng-click="advancedShowing = !advancedShowing"><span
ng-show="!advancedShowing">Show</span><span ng-show="advancedShowing">Hide</span>
Advanced</button>
-                <button type="button" class="btn btn-danger" ng-show="!settings.isNew"
ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
-                <button type="button" class="btn btn-success" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-danger" ng-if="!settings.isNew &&
!fulfill" ng-disabled="!deletable()" ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="!fulfill" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid || !saveable()" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="settings.isRequest
&& fulfill" ng-disabled="deliveryServiceForm.$invalid" ng-click="fulfillRequest(deliveryService)">Fulfill
Request</button>
             </div>
         </form>
     </div>
diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
index 67b4dd5..f1a9f25 100644
--- a/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
+++ b/traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.anyMap.tpl.html
@@ -26,16 +26,7 @@ under the License.
             <li class="active">{{deliveryServiceName}}</li>
         </ol>
         <div class="pull-right" role="group" ng-if="settings.isRequest">
-            <button class="btn btn-primary" title="Fulfill Request" ng-click="fulfill(deliveryService)">Fulfill
Request</button>
-            <div ng-if="changeType == 'update'" class="btn-group" role="group" uib-dropdown
is-open="more.isopen">
-                <button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle
aria-haspopup="true" aria-expanded="false">
-                    More
-                    <span class="caret"></span>
-                </button>
-                <ul class="dropdown-menu-right dropdown-menu" uib-dropdown-menu>
-                    <li role="menuitem"><a ng-click="showDiff()">Show Delivery
Service Diff</a></li>
-                </ul>
-            </div>
+            <button class="btn btn-link request-status" title="Edit Status" ng-disabled="!statusEditable()"
ng-click="editStatus()">[ {{requestStatus}} ]</button>
         </div>
         <div class="pull-right" role="group" ng-if="!settings.isRequest && !settings.isNew">
             <div class="btn-group" role="group" uib-dropdown is-open="keys.isopen">
@@ -291,8 +282,9 @@ under the License.
 
             <div class="modal-footer">
                 <button class="btn btn-link" ng-click="advancedShowing = !advancedShowing"><span
ng-show="!advancedShowing">Show</span><span ng-show="advancedShowing">Hide</span>
Advanced</button>
-                <button type="button" class="btn btn-danger" ng-show="!settings.isNew"
ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
-                <button type="button" class="btn btn-success" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-danger" ng-if="!settings.isNew &&
!fulfill" ng-disabled="!deletable()" ng-click="confirmDelete(deliveryService)">{{settings.deleteLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="!fulfill" ng-disabled="deliveryServiceForm.$pristine
|| deliveryServiceForm.$invalid || !saveable()" ng-click="save(deliveryService)">{{settings.saveLabel}}</button>
+                <button type="button" class="btn btn-success" ng-if="settings.isRequest
&& fulfill" ng-disabled="deliveryServiceForm.$invalid" ng-click="fulfillRequest(deliveryService)">Fulfill
Request</button>
             </div>
         </form>
     </div>
diff --git a/traffic_portal/app/src/common/modules/form/deliveryService/new/FormNewDeliveryServiceController.js
b/traffic_portal/app/src/common/modules/form/deliveryService/new/FormNewDeliveryServiceController.js
index c9f5e90..84ffff1 100644
--- a/traffic_portal/app/src/common/modules/form/deliveryService/new/FormNewDeliveryServiceController.js
+++ b/traffic_portal/app/src/common/modules/form/deliveryService/new/FormNewDeliveryServiceController.js
@@ -33,8 +33,8 @@ var FormNewDeliveryServiceController = function(deliveryService, type, types,
$s
 	$scope.save = function(deliveryService) {
 		if ($scope.dsRequestsEnabled) {
 			var params = {
-				title: "Create Delivery Service",
-				message: 'All new delivery services must be reviewed for completeness and accuracy before
deployment. A request will be created for you. Please select the status of your request.'
+				title: "Delivery Service Create Request",
+				message: 'All new delivery services must be reviewed for completeness and accuracy before
deployment.<br><br>Please select the status of your delivery service create request.'
 			};
 			var modalInstance = $uibModal.open({
 				templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
@@ -46,8 +46,8 @@ var FormNewDeliveryServiceController = function(deliveryService, type, types,
$s
 					},
 					collection: function() {
 						return [
-							{ id: $scope.DRAFT, name: 'Save Request as Draft' },
-							{ id: $scope.SUBMITTED, name: 'Submit Request for Review / Deployment' }
+							{ id: $scope.DRAFT, name: 'Save as Draft' },
+							{ id: $scope.SUBMITTED, name: 'Submit for Review and Deployment' }
 						];
 					}
 				}
diff --git a/traffic_portal/app/src/common/modules/table/_table.scss b/traffic_portal/app/src/common/modules/table/_table.scss
index 7449d60..59ac634 100644
--- a/traffic_portal/app/src/common/modules/table/_table.scss
+++ b/traffic_portal/app/src/common/modules/table/_table.scss
@@ -24,4 +24,8 @@
 
 .action-link {
   padding: 5px;
+}
+
+td span {
+  line-height: 19px;
 }
\ No newline at end of file
diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
b/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
index cfa2e77..6dd8980 100644
--- a/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
+++ b/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-var TableDeliveryServicesRequestsController = function(dsRequests, $scope, $state, $uibModal,
dateUtils, locationUtils, typeService, deliveryServiceRequestService, userModel) {
+var TableDeliveryServicesRequestsController = function(dsRequests, $scope, $state, $uibModal,
$anchorScroll, dateUtils, locationUtils, typeService, deliveryServiceRequestService, messageModel,
userModel) {
 
 	$scope.DRAFT = 0;
 	$scope.SUBMITTED = 1;
@@ -33,6 +33,30 @@ var TableDeliveryServicesRequestsController = function(dsRequests, $scope,
$stat
 		$state.reload(); // reloads all the resolves for the view
 	};
 
+	$scope.fulfillable = function(request) {
+		return request.status == 'submitted';
+	};
+
+	$scope.rejectable = function(request) {
+		return request.status == 'submitted';
+	};
+
+	$scope.completeable = function(request) {
+		return request.status == 'pending';
+	};
+
+	$scope.statusEditable = function(request) {
+		return (request.status == 'draft' || request.status == 'submitted');
+	};
+
+	$scope.assignable = function(request) {
+		return (request.status == 'draft' || request.status == 'submitted');
+	};
+
+	$scope.deleteable = function(request) {
+		return (request.status == 'draft' || request.status == 'submitted' || request.status ==
'rejected');
+	};
+
 	$scope.assignRequest = function(request, assign, $event) {
 		$event.stopPropagation(); // this kills the click event so it doesn't trigger anything
else
 		var params = {
@@ -76,10 +100,8 @@ var TableDeliveryServicesRequestsController = function(dsRequests, $scope,
$stat
 				},
 				collection: function() {
 					return [
-						{ id: $scope.DRAFT, name: 'Draft' },
-						{ id: $scope.SUBMITTED, name: 'Submitted' },
-						{ id: $scope.REJECTED, name: 'Rejected' },
-						{ id: $scope.COMPLETE, name: 'Complete' }
+						{ id: $scope.DRAFT, name: 'Save as Draft' },
+						{ id: $scope.SUBMITTED, name: 'Submit for Review / Deployment' }
 					];
 				}
 			}
@@ -91,12 +113,6 @@ var TableDeliveryServicesRequestsController = function(dsRequests, $scope,
$stat
 					break;
 				case $scope.SUBMITTED:
 					request.status = 'submitted';
-					break;
-				case $scope.REJECTED:
-					request.status = 'rejected';
-					break;
-				case $scope.COMPLETE:
-					request.status = 'complete';
 			}
 			deliveryServiceRequestService.updateDeliveryServiceRequest(request.id, request).
 				then(function() {
@@ -107,6 +123,68 @@ var TableDeliveryServicesRequestsController = function(dsRequests, $scope,
$stat
 		});
 	};
 
+	$scope.rejectRequest = function(request, $event) {
+		$event.stopPropagation(); // this kills the click event so it doesn't trigger anything
else
+		var params = {
+			title: 'Reject Delivery Service Request',
+			message: 'Are you sure you want to reject this delivery service request?'
+		};
+		var modalInstance = $uibModal.open({
+			templateUrl: 'common/modules/dialog/confirm/dialog.confirm.tpl.html',
+			controller: 'DialogConfirmController',
+			size: 'md',
+			resolve: {
+				params: function () {
+					return params;
+				}
+			}
+		});
+		modalInstance.result.then(function() {
+			request.assigneeId = userModel.user.id;
+			request.status = 'rejected';
+			deliveryServiceRequestService.updateDeliveryServiceRequest(request.id, request).
+			then(function() {
+				$scope.refresh();
+			});
+		}, function () {
+			// do nothing
+		});
+	};
+
+	$scope.completeRequest = function(request, $event) {
+		$event.stopPropagation(); // this kills the click event so it doesn't trigger anything
else
+
+		if (request.assigneeId != userModel.user.id) {
+			messageModel.setMessages([ { level: 'error', text: 'Only the Assignee can mark a delivery
service request as complete' } ], false);
+			$anchorScroll(); // scrolls window to top
+			return;
+		}
+
+		var params = {
+			title: 'Complete Delivery Service Request',
+			message: 'Are you sure you want to mark this delivery service request as complete?'
+		};
+		var modalInstance = $uibModal.open({
+			templateUrl: 'common/modules/dialog/confirm/dialog.confirm.tpl.html',
+			controller: 'DialogConfirmController',
+			size: 'md',
+			resolve: {
+				params: function () {
+					return params;
+				}
+			}
+		});
+		modalInstance.result.then(function() {
+			request.status = 'complete';
+			deliveryServiceRequestService.updateDeliveryServiceRequest(request.id, request).
+				then(function() {
+					$scope.refresh();
+				});
+		}, function () {
+			// do nothing
+		});
+	};
+
 	$scope.deleteRequest = function(request, $event) {
 		$event.stopPropagation(); // this kills the click event so it doesn't trigger anything
else
 		var params = {
@@ -133,6 +211,91 @@ var TableDeliveryServicesRequestsController = function(dsRequests, $scope,
$stat
 		});
 	};
 
+	$scope.createRequest = function() {
+		var params = {
+			title: 'Create Delivery Service Request',
+			message: 'What kind of delivery service request would you like to create?'
+		};
+		var modalInstance = $uibModal.open({
+			templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
+			controller: 'DialogSelectController',
+			size: 'md',
+			resolve: {
+				params: function () {
+					return params;
+				},
+				collection: function() {
+					return [
+						{ id: 1, name: 'A request for a new delivery service' },
+						{ id: 2, name: 'A request to update an existing delivery service' }
+					];
+				}
+			}
+		});
+		modalInstance.result.then(function(action) {
+			switch (action.id) {
+				case 1: // if you want to create a new DS
+					var params = {
+						title: 'Create Delivery Service',
+						message: "Please select a content routing category"
+					};
+					var modalInstance = $uibModal.open({
+						templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
+						controller: 'DialogSelectController',
+						size: 'md',
+						resolve: {
+							params: function () {
+								return params;
+							},
+							collection: function() {
+								// the following represent the 4 categories of delivery services
+								// the ids are arbitrary but the dialog.select dropdown needs them
+								return [
+									{ id: 1, name: 'ANY_MAP' },
+									{ id: 2, name: 'DNS' },
+									{ id: 3, name: 'HTTP' },
+									{ id: 4, name: 'STEERING' }
+								];
+							}
+						}
+					});
+					modalInstance.result.then(function(type) {
+						var path = '/delivery-services/new?type=' + type.name;
+						locationUtils.navigateToPath(path);
+					}, function () {
+						// do nothing
+					});
+					break;
+				case 2: // if you want to update an existing DS
+					var params = {
+						title: 'Update Delivery Service',
+						message: "Please select a delivery service to update",
+						labelFunction: function(item) { return item['xmlId'] }
+					};
+					var modalInstance = $uibModal.open({
+						templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
+						controller: 'DialogSelectController',
+						size: 'md',
+						resolve: {
+							params: function () {
+								return params;
+							},
+							collection: function(deliveryServiceService) {
+								return deliveryServiceService.getDeliveryServices();
+							}
+						}
+					});
+					modalInstance.result.then(function(ds) {
+						locationUtils.navigateToPath('/delivery-services/' + ds.id + '?type=' + ds.type);
+					}, function () {
+						// do nothing
+					});
+			}
+		}, function () {
+			// do nothing
+		});
+	};
+
 	$scope.editDeliveryServiceRequest = function(request) {
 		var path = '/delivery-service-requests/' + request.id + '?type=';
 		typeService.getType(request.request.typeId)
@@ -142,6 +305,16 @@ var TableDeliveryServicesRequestsController = function(dsRequests, $scope,
$stat
 			});
 	};
 
+	$scope.fulfillRequest = function(request, $event) {
+		$event.stopPropagation(); // this kills the click event so it doesn't trigger anything
else
+		var path = '/delivery-service-requests/' + request.id + '?type=';
+		typeService.getType(request.request.typeId)
+			.then(function(result) {
+				path += result.name + '&fulfill=true';
+				locationUtils.navigateToPath(path);
+			});
+	};
+
 	angular.element(document).ready(function () {
 		$('#dsRequestsTable').dataTable({
 			"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
@@ -155,5 +328,5 @@ var TableDeliveryServicesRequestsController = function(dsRequests, $scope,
$stat
 
 };
 
-TableDeliveryServicesRequestsController.$inject = ['dsRequests', '$scope', '$state', '$uibModal',
'dateUtils', 'locationUtils', 'typeService', 'deliveryServiceRequestService', 'userModel'];
+TableDeliveryServicesRequestsController.$inject = ['dsRequests', '$scope', '$state', '$uibModal',
'$anchorScroll', 'dateUtils', 'locationUtils', 'typeService', 'deliveryServiceRequestService',
'messageModel', 'userModel'];
 module.exports = TableDeliveryServicesRequestsController;
diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/table.deliveryServiceRequests.tpl.html
b/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/table.deliveryServiceRequests.tpl.html
index ade84a9..01fdabd 100644
--- a/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/table.deliveryServiceRequests.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/table.deliveryServiceRequests.tpl.html
@@ -23,6 +23,7 @@ under the License.
             <li class="active">Delivery Service Requests</li>
         </ol>
         <div class="pull-right" role="group">
+            <button class="btn btn-primary" title="Create Delivery Service Request" ng-click="createRequest()"><i
class="fa fa-plus"></i></button>
             <button class="btn btn-default" title="Refresh" ng-click="refresh()"><i
class="fa fa-refresh"></i></button>
         </div>
         <div class="clearfix"></div>
@@ -38,23 +39,29 @@ under the License.
                 <th>Author</th>
                 <th>Assignee</th>
                 <th>Last Updated</th>
-                <th></th>
+                <th style="text-align: right;">Actions</th>
             </tr>
             </thead>
             <tbody>
             <tr ng-click="editDeliveryServiceRequest(request)" ng-repeat="request in ::dsRequests">
                 <td data-search="^{{::request.request.xmlId}}$">{{::request.request.xmlId}}</td>
                 <td data-search="^{{::request.changeType}}$">{{::request.changeType}}</td>
-                <td data-search="^{{::request.status}}$">{{::request.status}}</td>
+                <td data-search="^{{::request.status}}$">
+                    <span ng-if="!statusEditable(request)">{{::request.status}}</span>
+                    <a ng-if="statusEditable(request)" class="link" title="Change Status"
ng-click="editStatus(request, $event)">{{::request.status}}</a>
+                </td>
                 <td data-search="^{{::request.author}}$">{{::request.author}}</td>
                 <td data-search="^{{::request.assignee}}$">
-                    <a ng-show="!request.assignee" class="link" title="Assign Yourself"
ng-click="assignRequest(request, true, $event)">No one - assign yourself</a>
-                    <a ng-show="request.assignee" class="link" title="Clear Assignee"
ng-click="assignRequest(request, false, $event)">{{::request.assignee}} - clear</a>
+                    <span ng-show="!assignable(request)">{{::request.assignee}}</span>
+                    <a ng-show="assignable(request) && !request.assignee" class="link"
title="Assign Yourself" ng-click="assignRequest(request, true, $event)">No one - assign
yourself</a>
+                    <a ng-show="assignable(request) && request.assignee" class="link"
title="Unassign" ng-click="assignRequest(request, false, $event)">{{::request.assignee}}
- unassign</a>
                 </td>
                 <td data-search="^{{::getRelativeTime(request.lastUpdated)}}$" data-order="{{::request.lastUpdated}}">{{::getRelativeTime(request.lastUpdated)}}</td>
                 <td style="text-align: right;">
-                    <a class="link action-link" title="Edit Status" ng-click="editStatus(request,
$event)">edit status</a>|
-                    <a class="link action-link" title="Delete Request" ng-click="deleteRequest(request,
$event)">delete</a>
+                    <span ng-if="fulfillable(request)"><a class="link action-link"
title="Fulfill Request" ng-click="fulfillRequest(request, $event)">fulfill</a>| </span>
+                    <span ng-if="rejectable(request)"><a class="link action-link"
title="Reject Request" ng-click="rejectRequest(request, $event)">reject</a>| </span>
+                    <span ng-if="completeable(request)"><a class="link action-link"
title="Complete Request" ng-click="completeRequest(request, $event)">complete</a></span>
+                    <span ng-if="deleteable(request)"><a class="link action-link"
title="Delete Request" ng-click="deleteRequest(request, $event)">delete</a></span>
                 </td>
             </tr>
             </tbody>
diff --git a/traffic_portal/app/src/common/modules/table/deliveryServices/table.deliveryServices.tpl.html
b/traffic_portal/app/src/common/modules/table/deliveryServices/table.deliveryServices.tpl.html
index 3453ad8..91ba83e 100644
--- a/traffic_portal/app/src/common/modules/table/deliveryServices/table.deliveryServices.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/deliveryServices/table.deliveryServices.tpl.html
@@ -22,7 +22,7 @@ under the License.
         <ol class="breadcrumb pull-left">
             <li class="active">Delivery Services</li>
         </ol>
-        <div class="pull-right" role="group" ng-if="!settings.isNew">
+        <div class="pull-right" role="group">
             <button class="btn btn-primary" title="Create Delivery Service" ng-click="selectDSType()"><i
class="fa fa-plus"></i></button>
             <button class="btn btn-default" title="Refresh" ng-click="refresh()"><i
class="fa fa-refresh"></i></button>
             <div class="btn-group" role="group" uib-dropdown is-open="more.isopen">
diff --git a/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
b/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
index ddf8a88..40f42f8 100644
--- a/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
+++ b/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/FormEditDeliveryServiceRequestController.js
@@ -26,8 +26,12 @@ var FormEditDeliveryServiceRequestController = function(deliveryServiceRequest,
 	
 	$scope.changeType = dsRequest.changeType;
 
+	$scope.requestStatus = dsRequest.status;
+
 	$scope.deliveryServiceName = angular.copy(dsRequest.request.xmlId);
 
+	$scope.fulfill = $stateParams.fulfill;
+
 	$scope.advancedShowing = true;
 
 	$scope.settings = {
@@ -37,15 +41,78 @@ var FormEditDeliveryServiceRequestController = function(deliveryServiceRequest,
 		deleteLabel: 'Delete Request'
 	};
 
-	$scope.fulfill = function(deliveryService) {
+	$scope.saveable = function() {
+		return (dsRequest.status == 'draft' || dsRequest.status == 'submitted');
+	};
+
+	$scope.deletable = function() {
+		return (dsRequest.status == 'draft' || dsRequest.status == 'submitted');
+	};
+
+	$scope.statusEditable = function() {
+		return (dsRequest.status == 'draft' || dsRequest.status == 'submitted' || dsRequest.status
== 'pending');
+	};
+
+	$scope.editStatus = function() {
+		var params = {
+			title: "Edit Delivery Service Request Status",
+			message: 'Please select the appropriate status for this request.'
+		};
+		var modalInstance = $uibModal.open({
+			templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
+			controller: 'DialogSelectController',
+			size: 'md',
+			resolve: {
+				params: function () {
+					return params;
+				},
+				collection: function() {
+					var statuses = [];
+					if (dsRequest.status == 'draft' || dsRequest.status == 'submitted') {
+						statuses.push({ id: $scope.DRAFT, name: 'Save as Draft' });
+						statuses.push({ id: $scope.SUBMITTED, name: 'Submit for Review / Deployment' });
+					} else if (dsRequest.status == 'pending') {
+						statuses.push({ id: $scope.COMPLETE, name: 'Complete' });
+					}
+					return statuses;
+				}
+			}
+		});
+		modalInstance.result.then(function(action) {
+			switch (action.id) {
+				case $scope.DRAFT:
+					dsRequest.status = 'draft';
+					break;
+				case $scope.SUBMITTED:
+					dsRequest.status = 'submitted';
+					break;
+				case $scope.COMPLETE:
+					if (dsRequest.assigneeId != userModel.user.id) {
+						messageModel.setMessages([ { level: 'error', text: 'Only the Assignee can mark a delivery
service request as complete' } ], false);
+						$anchorScroll(); // scrolls window to top
+						return;
+					}
+					dsRequest.status = 'complete';
+			}
+			deliveryServiceRequestService.updateDeliveryServiceRequest(dsRequest.id, dsRequest).
+				then(function() {
+					$state.reload();
+				});
+		}, function () {
+			// do nothing
+		});
+	};
+
+	$scope.fulfillRequest = function(ds) {
 		if (dsRequest.status != 'submitted') {
 			var msg = "Only 'submitted' delivery service requests can be fulfilled. This request is
in '" + dsRequest.status + "' status.";
-			messageModel.setMessages([ { level: 'warning', text: msg } ], false);
+			messageModel.setMessages([ { level: 'error', text: msg } ], false);
+			$anchorScroll(); // scrolls window to top
 			return;
 		}
 		var params = {
-			title: 'Delivery Service ' + $scope.changeType + ': ' + deliveryService.xmlId,
-			message: 'Are you sure you want to fulfill this delivery service request and ' + $scope.changeType
+ ' the ' + deliveryService.xmlId + ' delivery service?'
+			title: 'Delivery Service ' + $scope.changeType + ': ' + ds.xmlId,
+			message: 'Are you sure you want to fulfill this delivery service request and ' + $scope.changeType
+ ' the ' + ds.xmlId + ' delivery service with these configuration settings?'
 		};
 		var modalInstance = $uibModal.open({
 			templateUrl: 'common/modules/dialog/confirm/dialog.confirm.tpl.html',
@@ -65,9 +132,9 @@ var FormEditDeliveryServiceRequestController = function(deliveryServiceRequest,
 			deliveryServiceRequestService.updateDeliveryServiceRequest(dsRequest.id, dsRequest);
 			// now update or create the ds per the ds request
 			if ($scope.changeType == 'update') {
-				deliveryServiceService.updateDeliveryService(deliveryService);
+				deliveryServiceService.updateDeliveryService(ds, true);
 			} else if ($scope.changeType == 'create') {
-				deliveryServiceService.createDeliveryService(deliveryService);
+				deliveryServiceService.createDeliveryService(ds);
 			}
 		}, function () {
 			// do nothing
@@ -76,8 +143,8 @@ var FormEditDeliveryServiceRequestController = function(deliveryServiceRequest,
 
 	$scope.save = function(deliveryService) {
 		var params = {
-			title: 'Edit Delivery Service Request',
-			message: 'All delivery service changes must be reviewed for completeness and accuracy
before deployment. Please select the status of your request.'
+			title: 'Delivery Service Request Status',
+			message: 'Please select the status of your delivery service request.'
 		};
 		var modalInstance = $uibModal.open({
 			templateUrl: 'common/modules/dialog/select/dialog.select.tpl.html',
@@ -89,8 +156,8 @@ var FormEditDeliveryServiceRequestController = function(deliveryServiceRequest,
 				},
 				collection: function() {
 					return [
-						{ id: $scope.DRAFT, name: 'Save Request as Draft' },
-						{ id: $scope.SUBMITTED, name: 'Submit Request for Review / Deployment' }
+						{ id: $scope.DRAFT, name: 'Save as Draft' },
+						{ id: $scope.SUBMITTED, name: 'Submit for Review / Deployment' }
 					];
 				}
 			}
@@ -99,14 +166,15 @@ var FormEditDeliveryServiceRequestController = function(deliveryServiceRequest,
 			dsRequest.status = (action.id == $scope.SUBMITTED) ? 'submitted' : 'draft';
 			dsRequest.request = deliveryService;
 			deliveryServiceRequestService.updateDeliveryServiceRequest(dsRequest.id, dsRequest).
-				then(function() {
-					$anchorScroll(); // scrolls window to top
-				});
+			then(function() {
+				messageModel.setMessages([ { level: 'success', text: 'Updated delivery service request
for ' + dsRequest.request.xmlId + ' and set status to ' + dsRequest.status } ], false);
+				$anchorScroll(); // scrolls window to top
+				$state.reload();
+			});
 
 		}, function () {
 			// do nothing
 		});
-
 	};
 
 	$scope.confirmDelete = function(deliveryService) {
diff --git a/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/index.js
b/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/index.js
index ccb8747..fa3f250 100644
--- a/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/index.js
+++ b/traffic_portal/app/src/modules/private/deliveryServiceRequests/edit/index.js
@@ -22,7 +22,7 @@ module.exports = angular.module('trafficPortal.private.deliveryServiceRequests.e
 	.config(function($stateProvider, $urlRouterProvider) {
 		$stateProvider
 			.state('trafficPortal.private.deliveryServiceRequests.edit', {
-				url: '/{deliveryServiceRequestId:[0-9]{1,8}}?type',
+				url: '/{deliveryServiceRequestId:[0-9]{1,8}}?type&fulfill',
 				views: {
 					deliveryServiceRequestsContent: {
 						templateUrl: function ($stateParams) {
diff --git a/traffic_portal/app/src/styles/main.scss b/traffic_portal/app/src/styles/main.scss
index 8b69fee..46be37d 100755
--- a/traffic_portal/app/src/styles/main.scss
+++ b/traffic_portal/app/src/styles/main.scss
@@ -30,6 +30,7 @@ $fa-font-path: "../assets/fonts";
 @import "../common/modules/dialog/import/dialog.import";
 @import "../common/modules/dialog/text/dialog.text";
 @import "../common/modules/header/header";
+@import "../common/modules/form/form";
 @import "../common/modules/message/message";
 @import "../common/modules/navigation/navigation";
 @import "../common/modules/table/table";

-- 
To stop receiving notification emails like this one, please contact
dewrich@apache.org.

Mime
View raw message