From b1f154aff998c850cc1264a5b5e5740bcd000406 Mon Sep 17 00:00:00 2001 From: Jeremy Mitchell Date: Mon, 26 Oct 2020 16:06:38 -0600 Subject: [PATCH 1/3] do not mark dsr complete is ds update fails due to validation error --- .../edit/FormEditDeliveryServiceController.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 ceef853fbf..b8ece96f30 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 @@ -150,7 +150,7 @@ var FormEditDeliveryServiceController = function(deliveryService, origin, topolo // assign the ds request promises.push(deliveryServiceRequestService.assignDeliveryServiceRequest(response.id, userModel.user.id)); // set the status to 'complete' - promises.push(deliveryServiceRequestService.updateDeliveryServiceRequestStatus(response.id, 'complete')); + promises.push(deliveryServiceRequestService.updateDeliveryServiceRequestStatus(response.id, 'submitted')); } } ); @@ -234,13 +234,20 @@ var FormEditDeliveryServiceController = function(deliveryService, origin, topolo deliveryServiceService.updateDeliveryService(deliveryService). then( function() { + // upon successful update of ds, set the dsr to 'complete' + deliveryServiceRequestService.getDeliveryServiceRequests({ xmlId: deliveryService.xmlId, status: 'submitted' }).then( + function(response) { + deliveryServiceRequestService.updateDeliveryServiceRequestStatus(response[0].id, 'complete'); + } + ); $state.reload(); // reloads all the resolves for the view messageModel.setMessages([ { level: 'success', text: 'Delivery Service [ ' + deliveryService.xmlId + ' ] updated' } ], false); } ).catch(function(fault) { - $anchorScroll(); // scrolls window to top - messageModel.setMessages(fault.data.alerts, false); - }); + // if the ds update fails, send to dsr view w/ error message + locationUtils.navigateToPath('/delivery-service-requests'); + messageModel.setMessages(fault.data.alerts, true); + }); }).catch(function(fault) { $anchorScroll(); // scrolls window to top messageModel.setMessages(fault.data.alerts, false); From 1bd79cfbb8aba27b50430f651cc401e138f36eb9 Mon Sep 17 00:00:00 2001 From: Jeremy Mitchell Date: Mon, 26 Oct 2020 16:17:19 -0600 Subject: [PATCH 2/3] adds CHANGELOG.md entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d61122d65..17afded0d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added default sort logic to GET API calls using Read() ### Fixed +- Fixed #5188 - DSR (delivery service request) incorrectly marked as complete and error message not displaying when DSR fulfilled and DS update fails in Traffic Portal. [Related Github issues](https://github.com/apache/trafficcontrol/issues/5188) - Fixed #3455 - Alphabetically sorting CDN Read API call [Related Github issues](https://github.com/apache/trafficcontrol/issues/3455) - Fixed #5010 - Fixed Reference urls for Cache Config on Delivery service pages (HTTP, DNS) in Traffic Portal. [Related Github issues](https://github.com/apache/trafficcontrol/issues/5010) - Fixed #5147 - GET /servers?dsId={id} should only return mid servers (in addition to edge servers) for the cdn of the delivery service if the mid tier is employed. [Related github issues](https://github.com/apache/trafficcontrol/issues/5147) From 9cda2362ae21ea5ec7a09317032b7875c5681a92 Mon Sep 17 00:00:00 2001 From: Jeremy Mitchell Date: Mon, 26 Oct 2020 16:19:50 -0600 Subject: [PATCH 3/3] updates comment --- .../deliveryService/edit/FormEditDeliveryServiceController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b8ece96f30..26fa78626f 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 @@ -149,7 +149,7 @@ var FormEditDeliveryServiceController = function(deliveryService, origin, topolo if (autoFulfilled) { // assign the ds request promises.push(deliveryServiceRequestService.assignDeliveryServiceRequest(response.id, userModel.user.id)); - // set the status to 'complete' + // set the status to 'submitted' promises.push(deliveryServiceRequestService.updateDeliveryServiceRequestStatus(response.id, 'submitted')); } }