Skip to content

Commit

Permalink
VCST-1196: Ensure that saved editorial reviews are not marked as inhe…
Browse files Browse the repository at this point in the history
…rited (#730)

fix: Ensure that saved editorial reviews are not marked as inherited (#730)
  • Loading branch information
j-mok authored May 13, 2024
1 parent e739ad2 commit 93ccaa0
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ angular.module('virtoCommerce.catalogModule')
function ($scope, bladeNavigationService, FileUploader, settings, $timeout) {
var blade = $scope.blade;

function initilize() {
function initialize() {
if (!blade.item.reviews) {
blade.item.reviews = [];
}
Expand All @@ -24,15 +24,6 @@ angular.module('virtoCommerce.catalogModule')

$scope.isValid = true;

$scope.saveChanges = function () {
var existReview = _.find(blade.item.reviews, function (x) { return x == blade.origEntity; });
if (!existReview) {
blade.item.reviews.push(blade.origEntity);
};
angular.copy(blade.currentEntity, blade.origEntity);
$scope.bladeClose();
};

blade.headIcon = 'fa fa-comments';
blade.title = 'catalog.blades.editorialReview-detail.title';
blade.subtitle = 'catalog.blades.editorialReview-detail.subtitle';
Expand Down Expand Up @@ -102,8 +93,9 @@ angular.module('virtoCommerce.catalogModule')
var existReview = _.find(blade.item.reviews, function (x) { return x === blade.origEntity; });
if (!existReview) {
blade.item.reviews.push(blade.origEntity);
};
}

blade.currentEntity.isInherited = false;
angular.copy(blade.currentEntity, blade.origEntity);
}

Expand All @@ -119,5 +111,5 @@ angular.module('virtoCommerce.catalogModule')
bladeNavigationService.showConfirmationIfNeeded(isDirty(), canSave(), blade, saveChanges, closeCallback, "catalog.dialogs.review-save.title", "catalog.dialogs.review-save.message");
};

initilize();
initialize();
}]);

0 comments on commit 93ccaa0

Please sign in to comment.