From 7ee73c9e1c4a5267e28d44d777aa413dc7119223 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Tue, 21 Jun 2022 21:16:19 +0000 Subject: [PATCH] Update Designate dashboard for Angular 1.8.2.2 This patch updates Designate dashboard for breaking changes in the update to Angular 1.8.2.2 in horizon[1]. [1] https://review.opendev.org/c/openstack/requirements/+/844099 Change-Id: Ic8245f5da712d044b66ab19610885a112b75a4a5 --- .../resources/os-designate-floatingip/api.service.js | 6 +++--- .../os-designate-recordset/actions/delete.service.js | 4 ++-- .../resources/os-designate-recordset/api.service.js | 8 ++++---- .../os-designate-zone/actions/delete.service.js | 4 ++-- .../resources/os-designate-zone/api.service.js | 12 ++++++------ 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/designatedashboard/static/designatedashboard/resources/os-designate-floatingip/api.service.js b/designatedashboard/static/designatedashboard/resources/os-designate-floatingip/api.service.js index 5881dca..1f766e2 100644 --- a/designatedashboard/static/designatedashboard/resources/os-designate-floatingip/api.service.js +++ b/designatedashboard/static/designatedashboard/resources/os-designate-floatingip/api.service.js @@ -62,7 +62,7 @@ function list(params) { var config = params ? {'params': params} : {}; return httpService.get(apiPassthroughUrl + 'v2/reverse/floatingips', config) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to retrieve the floating ip PTRs.')); }); } @@ -70,7 +70,7 @@ function get(id, params) { var config = params ? {'params': params} : {}; return httpService.get(apiPassthroughUrl + 'v2/reverse/floatingips/' + id, config) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to get the floating ip PTR ' + id)); }); } @@ -95,7 +95,7 @@ ttl: data.ttl }; return httpService.patch(apiPassthroughUrl + 'v2/reverse/floatingips/' + floatingIpID, apiData) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to set the floating IP PTR record.')); }) } diff --git a/designatedashboard/static/designatedashboard/resources/os-designate-recordset/actions/delete.service.js b/designatedashboard/static/designatedashboard/resources/os-designate-recordset/actions/delete.service.js index 5de2e38..1c81f72 100644 --- a/designatedashboard/static/designatedashboard/resources/os-designate-recordset/actions/delete.service.js +++ b/designatedashboard/static/designatedashboard/resources/os-designate-recordset/actions/delete.service.js @@ -102,10 +102,10 @@ } function afterCheck(scope, result) { - var outcome = $q.reject(); // Reject the promise by default + var outcome = $q.reject().catch(angular.noop); // Reject the promise by default if (result.fail.length > 0) { toast.add('error', getMessage(notAllowedMessage, result.fail)); - outcome = $q.reject(result.fail); + outcome = $q.reject(result.fail).catch(angular.noop); } if (result.pass.length > 0) { // Remember the record sets we are allowed to delete so that on delete modal submit diff --git a/designatedashboard/static/designatedashboard/resources/os-designate-recordset/api.service.js b/designatedashboard/static/designatedashboard/resources/os-designate-recordset/api.service.js index 25cb51f..7e3ada3 100644 --- a/designatedashboard/static/designatedashboard/resources/os-designate-recordset/api.service.js +++ b/designatedashboard/static/designatedashboard/resources/os-designate-recordset/api.service.js @@ -63,7 +63,7 @@ */ function list(zoneId, params) { return httpService.get(apiPassthroughUrl + 'v2/zones/' + zoneId + '/recordsets/', params) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to retrieve the record sets.')); }); } @@ -107,14 +107,14 @@ */ function deleteRecordSet(zoneId, recordSetId) { return httpService.delete(apiPassthroughUrl + 'v2/zones/' + zoneId + '/recordsets/' + recordSetId + '/') - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to delete the record set.')); }); } function create(zoneId, data) { return httpService.post(apiPassthroughUrl + 'v2/zones/' + zoneId + '/recordsets/', data) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to create the record set.')); }); } @@ -128,7 +128,7 @@ records: data.records }; return httpService.put(apiPassthroughUrl + 'v2/zones/' + zoneId + '/recordsets/' + recordSetId, apiData) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to update the record set.')); }); } diff --git a/designatedashboard/static/designatedashboard/resources/os-designate-zone/actions/delete.service.js b/designatedashboard/static/designatedashboard/resources/os-designate-zone/actions/delete.service.js index a5192e3..e0bd9c0 100644 --- a/designatedashboard/static/designatedashboard/resources/os-designate-zone/actions/delete.service.js +++ b/designatedashboard/static/designatedashboard/resources/os-designate-zone/actions/delete.service.js @@ -104,10 +104,10 @@ } function afterCheck(scope, result) { - var outcome = $q.reject(); // Reject the promise by default + var outcome = $q.reject().catch(angular.noop); // Reject the promise by default if (result.fail.length > 0) { toast.add('error', getMessage(notAllowedMessage, result.fail)); - outcome = $q.reject(result.fail); + outcome = $q.reject(result.fail).catch(angular.noop); } if (result.pass.length > 0) { outcome = deleteModal.open(scope, result.pass.map(getEntity), context).then(createResult); diff --git a/designatedashboard/static/designatedashboard/resources/os-designate-zone/api.service.js b/designatedashboard/static/designatedashboard/resources/os-designate-zone/api.service.js index 44638cb..7e8ea5e 100644 --- a/designatedashboard/static/designatedashboard/resources/os-designate-zone/api.service.js +++ b/designatedashboard/static/designatedashboard/resources/os-designate-zone/api.service.js @@ -64,14 +64,14 @@ function list(params) { var config = params ? {'params': params} : {}; return httpService.get('/api/designate/zones/', config) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to retrieve the zone.')); }); }*/ function list(params) { var config = params ? {'params': params} : {}; return httpService.get(apiPassthroughUrl + 'v2/zones/', config) - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to retrieve the zone.')); }); } @@ -88,7 +88,7 @@ */ function get(id) { return httpService.get(apiPassthroughUrl + 'v2/zones/' + id + '/') - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to retrieve the zone.')); }); } @@ -102,7 +102,7 @@ */ function deleteZone(id) { return httpService.delete(apiPassthroughUrl + 'v2/zones/' + id + '/') - .error(function () { + .catch(function () { toastService.add('error', gettext('Unable to delete the zone.')); }); } @@ -119,7 +119,7 @@ */ function create(data) { return httpService.post(apiPassthroughUrl + 'v2/zones/', data) - .error(function() { + .catch(function() { toastService.add('error', gettext('Unable to create the zone.')); }) } @@ -144,7 +144,7 @@ description: data.description }; return httpService.patch(apiPassthroughUrl + 'v2/zones/' + id + '/', apiData ) - .error(function() { + .catch(function() { toastService.add('error', gettext('Unable to update the zone.')); }) }