@bigbinary/neeto-commons-frontend 2.0.26 → 2.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -789,6 +789,10 @@ var shouldNot = function shouldNot(skip) {
789
789
  return _typeof(skip) === "object" || !skip;
790
790
  };
791
791
 
792
+ var shouldShowToastr = function shouldShowToastr(response) {
793
+ return typeof response === "string" || _typeof(response) === "object" && ((response === null || response === void 0 ? void 0 : response.notice) || (response === null || response === void 0 ? void 0 : response.noticeCode));
794
+ };
795
+
792
796
  var setAuthHeaders = function setAuthHeaders() {
793
797
  var _document$querySelect, _axios$defaults$heade, _globalProps$user, _globalProps$user2;
794
798
 
@@ -841,8 +845,8 @@ var showSuccessToastr = function showSuccessToastr(response) {
841
845
  var _response$config$show = response.config.showToastr,
842
846
  showToastr = _response$config$show === void 0 ? true : _response$config$show;
843
847
 
844
- if (showToastr && typeof response.data.notice === "string") {
845
- neetoui.Toastr.success(response.data.notice);
848
+ if (showToastr && shouldShowToastr(response.data)) {
849
+ neetoui.Toastr.success(response.data);
846
850
  }
847
851
 
848
852
  return response;
@@ -985,7 +989,7 @@ var generic = {
985
989
  };
986
990
  var authentication = {
987
991
  notLoggedIn: "Could not authenticate, please login to continue!",
988
- couldNotAuth: "Could not authenticate with the provided %{parameter}.",
992
+ couldNotAuth: "Could not authenticate with the provided {{parameter}}.",
989
993
  incorrectPassword: "Current password is incorrect. Please try again.",
990
994
  incorrectEmailPassword: "Incorrect email or password. Please try again."
991
995
  };
package/initializers.js CHANGED
@@ -777,6 +777,10 @@ var shouldNot = function shouldNot(skip) {
777
777
  return _typeof(skip) === "object" || !skip;
778
778
  };
779
779
 
780
+ var shouldShowToastr = function shouldShowToastr(response) {
781
+ return typeof response === "string" || _typeof(response) === "object" && ((response === null || response === void 0 ? void 0 : response.notice) || (response === null || response === void 0 ? void 0 : response.noticeCode));
782
+ };
783
+
780
784
  var setAuthHeaders = function setAuthHeaders() {
781
785
  var _document$querySelect, _axios$defaults$heade, _globalProps$user, _globalProps$user2;
782
786
 
@@ -829,8 +833,8 @@ var showSuccessToastr = function showSuccessToastr(response) {
829
833
  var _response$config$show = response.config.showToastr,
830
834
  showToastr = _response$config$show === void 0 ? true : _response$config$show;
831
835
 
832
- if (showToastr && typeof response.data.notice === "string") {
833
- Toastr.success(response.data.notice);
836
+ if (showToastr && shouldShowToastr(response.data)) {
837
+ Toastr.success(response.data);
834
838
  }
835
839
 
836
840
  return response;
@@ -973,7 +977,7 @@ var generic = {
973
977
  };
974
978
  var authentication = {
975
979
  notLoggedIn: "Could not authenticate, please login to continue!",
976
- couldNotAuth: "Could not authenticate with the provided %{parameter}.",
980
+ couldNotAuth: "Could not authenticate with the provided {{parameter}}.",
977
981
  incorrectPassword: "Current password is incorrect. Please try again.",
978
982
  incorrectEmailPassword: "Incorrect email or password. Please try again."
979
983
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",