aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranushadasari <danush10@in.ibm.com>2019-08-05 22:27:57 +0530
committeranushadasari <danush10@in.ibm.com>2019-08-05 22:29:42 +0530
commit70638d1eb225acbc61e00ddbf9356aef38e8f143 (patch)
tree4f2c738a76c4061a863aed2ceeb9f68d1ea274fa
parent86a2c9e15470079d818b37d01fb01771e951622e (diff)
Major- Replace comparison Operators
The == and != operators do type coercion before comparing values. This is bad because it can mask type errors. For example, it evaluates ' \t\r\n' == 0 as true. It is best to always use the side-effect-less === and !== operators instead. Issue-ID: CCSDK-1583 Change-Id: I202ada53b472542261ee69623ea72b52005fdfab Signed-off-by: anushadasari <danush10@in.ibm.com>
-rw-r--r--ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/blueprint-controllers.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/blueprint-controllers.js b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/blueprint-controllers.js
index 2590de1..c764165 100644
--- a/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/blueprint-controllers.js
+++ b/ccsdk-app-overlay/src/main/webapp/app/ccsdk/cloudify/blueprint-controllers.js
@@ -241,13 +241,13 @@ appDS2.controller('blueprintUploadCtrl', function(
$scope.ecdapp.validateRequest = function(uploadRequest) {
if (uploadRequest == null)
return "No data found.\nPlease enter some values.";
- if (uploadRequest.blueprint_id == null || uploadRequest.blueprint_id.trim() == '')
+ if (uploadRequest.blueprint_id == null || uploadRequest.blueprint_id.trim() === '')
return "ID is required.\nPlease enter a value.";
- if (uploadRequest.blueprint_filename == null || uploadRequest.blueprint_filename.trim() == '')
+ if (uploadRequest.blueprint_filename == null || uploadRequest.blueprint_filename.trim() === '')
return "File name is required.\nPlease enter a value.";
- if (uploadRequest.blueprint_filename.toLowerCase().substr(-4) != 'yaml')
+ if (uploadRequest.blueprint_filename.toLowerCase().substr(-4) !== 'yaml')
return "File name must end with YAML.\nPlease use that suffix.";
- if (uploadRequest.zip_url == null || uploadRequest.zip_url.trim() == '')
+ if (uploadRequest.zip_url == null || uploadRequest.zip_url.trim() === '')
return "Zip file URL is required.\nPlease enter a value.";
return null;
}