Skip to content

Commit

Permalink
fix(rosco): Re-evaluate roscoSelector on stage updates (#7577)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmquach committed Oct 29, 2019
1 parent dae00c8 commit d620e05
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ module.exports = angular
});
}

function stageUpdated() {
deleteEmptyProperties();
// Since the selector computes using stage as an input, it needs to be able to recompute roscoMode on updates
if (typeof SETTINGS.feature.roscoSelector === 'function') {
$scope.viewState.roscoMode = SETTINGS.feature.roscoSelector($scope.stage);
}
}

function deleteEmptyProperties() {
_.forOwn($scope.stage, function(val, key) {
if (val === '') {
Expand Down Expand Up @@ -195,7 +203,7 @@ module.exports = angular
}
};

$scope.$watch('stage', deleteEmptyProperties, true);
$scope.$watch('stage', stageUpdated, true);

initialize();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ module.exports = angular
$scope.stage.osType = selectedOption.osType;
};

function stageUpdated() {
deleteEmptyProperties();
// Since the selector computes using stage as an input, it needs to be able to recompute roscoMode on updates
if (typeof SETTINGS.feature.roscoSelector === 'function') {
$scope.viewState.roscoMode = SETTINGS.feature.roscoSelector($scope.stage);
}
}

function deleteEmptyProperties() {
_.forOwn($scope.stage, function(val, key) {
if (val === '') {
Expand Down Expand Up @@ -154,7 +162,7 @@ module.exports = angular
return $scope.viewState.roscoMode || $scope.stage.varFileName;
};

$scope.$watch('stage', deleteEmptyProperties, true);
$scope.$watch('stage', stageUpdated, true);

initialize();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ module.exports = angular
);
}

function stageUpdated() {
deleteEmptyProperties();
// Since the selector computes using stage as an input, it needs to be able to recompute roscoMode on updates
if (typeof SETTINGS.feature.roscoSelector === 'function') {
$scope.viewState.roscoMode = SETTINGS.feature.roscoSelector($scope.stage);
}
}

function deleteEmptyProperties() {
_.forOwn($scope.stage, function(val, key) {
if (val === '') {
Expand Down Expand Up @@ -157,7 +165,7 @@ module.exports = angular
return $scope.viewState.roscoMode || $scope.stage.varFileName;
};

$scope.$watch('stage', deleteEmptyProperties, true);
$scope.$watch('stage', stageUpdated, true);

initialize();
},
Expand Down

0 comments on commit d620e05

Please sign in to comment.