diff --git a/refstack-ui/app/components/products/products.html b/refstack-ui/app/components/products/products.html index 679adcc2..9b103ecc 100644 --- a/refstack-ui/app/components/products/products.html +++ b/refstack-ui/app/components/products/products.html @@ -33,7 +33,7 @@

-

Add new Product

+

Add New Product

@@ -66,7 +66,13 @@
+
+ + Success: + Product successfully created. +
+
diff --git a/refstack-ui/app/components/products/productsController.js b/refstack-ui/app/components/products/productsController.js index 2338bdcd..b66caa38 100644 --- a/refstack-ui/app/components/products/productsController.js +++ b/refstack-ui/app/components/products/productsController.js @@ -182,6 +182,8 @@ * This will add new Product record. */ function addProduct() { + ctrl.showSuccess = false; + ctrl.showError = false; var url = refstackApiUrl + '/products'; var data = { name: ctrl.name, @@ -189,10 +191,12 @@ organization_id: ctrl.organizationId, product_type: parseInt(ctrl.productType) }; - ctrl.name = ''; - ctrl.description = ''; $http.post(url, data).success(function (data) { ctrl.rawData = null; + ctrl.showSuccess = true; + ctrl.name = ''; + ctrl.description = ''; + ctrl.productType = null; ctrl.update(); }).error(function (error) { ctrl.showError = true; diff --git a/refstack-ui/app/components/vendors/vendors.html b/refstack-ui/app/components/vendors/vendors.html index 26acc3c0..a336b174 100644 --- a/refstack-ui/app/components/vendors/vendors.html +++ b/refstack-ui/app/components/vendors/vendors.html @@ -35,7 +35,7 @@

-

Add new vendor

+

Add New Vendor

Creating a vendor allows you to associate test results to specific vendors/products. Created vendors are private, but vendors can be registered with the Foundation to become public and official. This will require approval by a Foundation administrator.

@@ -58,7 +58,13 @@
+
+ + Success: + Vendor successfully created. +
+
diff --git a/refstack-ui/app/components/vendors/vendorsController.js b/refstack-ui/app/components/vendors/vendorsController.js index d597915c..766195a4 100644 --- a/refstack-ui/app/components/vendors/vendorsController.js +++ b/refstack-ui/app/components/vendors/vendorsController.js @@ -141,14 +141,17 @@ * This will add a new vendor record. */ function addVendor() { + ctrl.showSuccess = false; + ctrl.showError = false; var url = refstackApiUrl + '/vendors'; var data = { name: ctrl.name, description: ctrl.description }; - ctrl.name = ''; - ctrl.description = ''; $http.post(url, data).success(function (data) { + ctrl.showSuccess = true; + ctrl.name = ''; + ctrl.description = ''; ctrl.rawData = null; ctrl.update(); }).error(function (error) {