Merge pull request #8661 from SuprajaRamesh/fixing-missing-translation

Fixing missing translation for "Are you sure?" when deleting a product
This commit is contained in:
Matt-Yorkley
2022-01-05 15:08:45 +00:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -144,7 +144,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$scope.variantIdCounter
$scope.deleteProduct = (product) ->
if confirm("Are you sure?")
if confirm(t('are_you_sure'))
$http(
method: "DELETE"
url: "/api/v0/products/" + product.id

View File

@@ -822,6 +822,7 @@ describe "AdminProductEditCtrl", ->
$scope.dirtyProducts = {}
$httpBackend.expectDELETE("/api/v0/products/13").respond 200, "data"
$scope.deleteProduct $scope.products[1]
expect(window.confirm).toHaveBeenCalledWith "Are you sure?"
$httpBackend.flush()
it "removes the specified product from both $scope.products and $scope.dirtyProducts (if it exists there)", ->