mitchell852 commented on a change in pull request #5072:
URL: https://github.com/apache/trafficcontrol/pull/5072#discussion_r495124522
##########
File path: traffic_portal/app/src/common/modules/header/HeaderController.js
##########
@@ -23,9 +23,9 @@ var HeaderController = function($rootScope, $scope, $state,
$uibModal, $location
$scope.userLoaded = userModel.loaded;
- $scope.enviroName = propertiesModel.properties.environment.name;
+ $scope.enviroName = (propertiesModel.properties.environment) ?
propertiesModel.properties.environment.name : '';
Review comment:
yeah, it won't find `.name` so it will treat it as undefined and the UI
will cast undefined to a string. so works very well. same with `.isProd` which
is cast to the falsy boolean: false. tested and verified.
##########
File path: traffic_portal/app/src/common/modules/header/HeaderController.js
##########
@@ -23,9 +23,9 @@ var HeaderController = function($rootScope, $scope, $state,
$uibModal, $location
$scope.userLoaded = userModel.loaded;
- $scope.enviroName = propertiesModel.properties.environment.name;
+ $scope.enviroName = (propertiesModel.properties.environment) ?
propertiesModel.properties.environment.name : '';
- $scope.isProd = propertiesModel.properties.environment.isProd;
+ $scope.isProd = (propertiesModel.properties.environment) ?
propertiesModel.properties.environment.isProd : false;
Review comment:
see prev comment
##########
File path:
traffic_portal/app/src/common/modules/navigation/NavigationController.js
##########
@@ -21,7 +21,7 @@ var NavigationController = function($scope, $log, $state,
$location, $window, $t
$scope.appName = propertiesModel.properties.name;
- $scope.isProd = propertiesModel.properties.environment.isProd;
+ $scope.isProd = (propertiesModel.properties.environment) ?
propertiesModel.properties.environment.isProd : false;
Review comment:
see prev comment.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]