From 7edf48ec5c9d61b8082d40a7ab4189f389689f12 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Jourel Date: Tue, 20 Sep 2022 13:53:57 +0000 Subject: [PATCH] Fix ESLint warnings This change fix all `consistent-return` in ESLint. Change-Id: I8a5db7205da58f9626ca5e5c060ed2a51d700852 --- .../lbaasv2/healthmonitors/healthmonitors.module.spec.js | 4 +--- .../project/lbaasv2/l7policies/l7policies.module.spec.js | 4 +--- .../dashboard/project/lbaasv2/l7rules/l7rules.module.spec.js | 4 +--- .../project/lbaasv2/listeners/listeners.module.spec.js | 4 +--- .../loadbalancers/actions/delete/delete.action.service.js | 1 + .../lbaasv2/loadbalancers/loadbalancers.module.spec.js | 4 +--- .../project/lbaasv2/loadbalancers/loadbalancers.service.js | 1 + .../dashboard/project/lbaasv2/members/members.module.spec.js | 4 +--- .../dashboard/project/lbaasv2/pools/pools.module.spec.js | 4 +--- .../dashboard/project/lbaasv2/workflow/modal.service.js | 1 + 10 files changed, 10 insertions(+), 21 deletions(-) diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/healthmonitors/healthmonitors.module.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/healthmonitors/healthmonitors.module.spec.js index d9fc0a6d..f77f6d55 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/healthmonitors/healthmonitors.module.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/healthmonitors/healthmonitors.module.spec.js @@ -57,9 +57,7 @@ return list.filter(matchesId).length === 1; function matchesId(action) { - if (action.id === value) { - return true; - } + return action.id === value; } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/l7policies/l7policies.module.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/l7policies/l7policies.module.spec.js index 9a33b1ff..bf32287e 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/l7policies/l7policies.module.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/l7policies/l7policies.module.spec.js @@ -56,9 +56,7 @@ return list.filter(matchesId).length === 1; function matchesId(action) { - if (action.id === value) { - return true; - } + return action.id === value; } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/l7rules/l7rules.module.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/l7rules/l7rules.module.spec.js index 6fc42122..9a71e94c 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/l7rules/l7rules.module.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/l7rules/l7rules.module.spec.js @@ -56,9 +56,7 @@ return list.filter(matchesId).length === 1; function matchesId(action) { - if (action.id === value) { - return true; - } + return action.id === value; } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.spec.js index 48bb71d9..e055b87c 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/listeners/listeners.module.spec.js @@ -57,9 +57,7 @@ return list.filter(matchesId).length === 1; function matchesId(action) { - if (action.id === value) { - return true; - } + return action.id === value; } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.js b/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.js index e4e6c3bc..af764a5f 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.js @@ -147,6 +147,7 @@ if (result.pass.length > 0) { return deleteModal.open(scope, result.pass.map(getEntity), context).then(deleteResult); } + return null; } function deleteItem(id) { diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.module.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.module.spec.js index e995caeb..7aeae392 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.module.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.module.spec.js @@ -59,9 +59,7 @@ return list.filter(matchesId).length === 1; function matchesId(action) { - if (action.id === value) { - return true; - } + return action.id === value; } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.service.js b/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.service.js index 8df02e97..b8b6863d 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.service.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/loadbalancers/loadbalancers.service.js @@ -364,6 +364,7 @@ if (['ACTIVE', 'ERROR'].indexOf(response.data.provisioning_status) < 0) { return $q.reject(); } + return null; }); } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/members/members.module.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/members/members.module.spec.js index e88b0644..e08b9468 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/members/members.module.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/members/members.module.spec.js @@ -57,9 +57,7 @@ return list.filter(matchesId).length === 1; function matchesId(action) { - if (action.id === value) { - return true; - } + return action.id === value; } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/pools/pools.module.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/pools/pools.module.spec.js index 4a2c226b..cb437697 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/pools/pools.module.spec.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/pools/pools.module.spec.js @@ -57,9 +57,7 @@ return list.filter(matchesId).length === 1; function matchesId(action) { - if (action.id === value) { - return true; - } + return action.id === value; } } diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js index 11364f4f..ccc91d75 100644 --- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js +++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js @@ -107,6 +107,7 @@ $rootScope.$broadcast(events.ACTION_DONE); return args.handle(response); } + return null; } }