Skip to content

Commit

Permalink
fix(webapp): fix bug with search widget translations
Browse files Browse the repository at this point in the history
related to CAM-14149
  • Loading branch information
danielkelemen committed May 6, 2022
1 parent 905a50e commit fda59a6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports = [
$scope.translations[key] = $translate.instant(value);
});

if ($scope.types)
const initTypes = () => {
$scope.types.map(function(el) {
el.id.value = $translate.instant(el.id.value);
if (el.operators) {
Expand All @@ -164,6 +164,9 @@ module.exports = [
}
return el;
});
}

if ($scope.types) initTypes();

angular.forEach($scope.operators, function(operatorGroupedByType) {
angular.forEach(operatorGroupedByType, function(operator) {
Expand Down Expand Up @@ -827,6 +830,7 @@ module.exports = [
$scope.$watch(
'types',
function() {
initTypes();
//in case if array of types changed - update dropdown values
$scope.searchTypes = $scope.types.map(function(el) {
return el.id;
Expand Down

0 comments on commit fda59a6

Please sign in to comment.