@bigbinary/neeto-commons-frontend 2.0.24 → 2.0.25
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.
- package/README.md +1 -1
- package/initializers.cjs.js +103 -0
- package/initializers.js +103 -0
- package/package.json +3 -2
- package/react-utils.cjs.js +4407 -585
- package/react-utils.d.ts +6 -0
- package/react-utils.js +4410 -591
package/README.md
CHANGED
package/initializers.cjs.js
CHANGED
|
@@ -980,6 +980,81 @@ function initializeGlobalProps() {
|
|
|
980
980
|
deepFreezeObject(window.globalProps);
|
|
981
981
|
}
|
|
982
982
|
|
|
983
|
+
var generic = {
|
|
984
|
+
error: "Something went wrong. Please try again later."
|
|
985
|
+
};
|
|
986
|
+
var authentication = {
|
|
987
|
+
notLoggedIn: "Could not authenticate, please login to continue!",
|
|
988
|
+
couldNotAuth: "Could not authenticate with the provided %{parameter}.",
|
|
989
|
+
incorrectPassword: "Current password is incorrect. Please try again.",
|
|
990
|
+
incorrectEmailPassword: "Incorrect email or password. Please try again."
|
|
991
|
+
};
|
|
992
|
+
var authorization = {
|
|
993
|
+
unauthorized: "You are not authorized to perform this action."
|
|
994
|
+
};
|
|
995
|
+
var resource = {
|
|
996
|
+
add_one: "{{entity}} has been added successfully.",
|
|
997
|
+
add_other: "{{entity}} have been added successfully.",
|
|
998
|
+
save: "{{entity}} has been saved successfully.",
|
|
999
|
+
update: "{{entity}} has been updated successfully.",
|
|
1000
|
+
delete_one: "{{entity}} has been deleted successfully.",
|
|
1001
|
+
delete_other: "{{entity}} have been deleted successfully.",
|
|
1002
|
+
clone: "{{entity}} has been cloned successfully.",
|
|
1003
|
+
notFound: "{{entity}} does not exist.",
|
|
1004
|
+
remove_one: "{{entity}} successfully removed",
|
|
1005
|
+
remove_other: "{{entity}}s successfully removed",
|
|
1006
|
+
sent: "{{entity}} sent successfully."
|
|
1007
|
+
};
|
|
1008
|
+
var otp = {
|
|
1009
|
+
sent: "OTP has been sent successfully.",
|
|
1010
|
+
invalid: "Invalid OTP",
|
|
1011
|
+
verified: "OTP has been verified successfully."
|
|
1012
|
+
};
|
|
1013
|
+
var upload = {
|
|
1014
|
+
error: "An error occured while uploading the file"
|
|
1015
|
+
};
|
|
1016
|
+
var image = {
|
|
1017
|
+
profile: {
|
|
1018
|
+
removalFailed: "Failed to remove profile picture",
|
|
1019
|
+
removalSuccess: "Profile picture successfully removed"
|
|
1020
|
+
},
|
|
1021
|
+
contentTypeInvalid: "Other than jpg, png, svg are not supported",
|
|
1022
|
+
sizeOutOfRange: "Should not be more than {{maxSize, number}} MB"
|
|
1023
|
+
};
|
|
1024
|
+
var userRole = {
|
|
1025
|
+
deactivateActiveAdmin: "You cannot deactivate active admin from the organization!"
|
|
1026
|
+
};
|
|
1027
|
+
var activeRecord = {
|
|
1028
|
+
error: {
|
|
1029
|
+
blankName: "Name can't be blank",
|
|
1030
|
+
blankDescription: "Description can't be blank",
|
|
1031
|
+
blankValue: "Value can't be blank",
|
|
1032
|
+
prefixType: "Prefix type {{value}} is not valid",
|
|
1033
|
+
minimumEntryLimit: "Minimum entry limit must be less than or equal to {{maximumEntryLimit, number}}",
|
|
1034
|
+
maximumEntryLimit: "Maximum entry limit must be greater than or equal to {{minimumEntryLimit, number}}"
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
var sessions = {
|
|
1038
|
+
expiry: "Your session has expired. Please login again."
|
|
1039
|
+
};
|
|
1040
|
+
var payment = {
|
|
1041
|
+
error: {
|
|
1042
|
+
incomplete: "Your payment could not be completed"
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
var invitations = {
|
|
1046
|
+
deleted_one: "Invitation has been deleted successfully",
|
|
1047
|
+
deleted_other: "{{count, number}} Invitations have been deleted successfully",
|
|
1048
|
+
sent_one: "Invitation has been sent successfully",
|
|
1049
|
+
sent_other: "{{count, number}} Invitations have been sent successfully",
|
|
1050
|
+
notFound: "{{email}} was not invited to test this website."
|
|
1051
|
+
};
|
|
1052
|
+
var github = {
|
|
1053
|
+
error: {
|
|
1054
|
+
webhookPermissionDenied: "Permission denied. Ensure you have permission to create webhooks for the repository.",
|
|
1055
|
+
primaryNonDeletable: "Primary Github account cannot be deleted."
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
983
1058
|
var neetoCommons = {
|
|
984
1059
|
errorPage: {
|
|
985
1060
|
cantBeFound: "The page you're looking for <br /> can't be found.",
|
|
@@ -1155,9 +1230,37 @@ var neetoCommons = {
|
|
|
1155
1230
|
buttonLabel: "Contact us"
|
|
1156
1231
|
},
|
|
1157
1232
|
unknownBrowserMsg: "an unknown browser"
|
|
1233
|
+
},
|
|
1234
|
+
ipRestriction: {
|
|
1235
|
+
switchLabel: "Enable IP restriction",
|
|
1236
|
+
description: "Restrict access to only trusted locations and networks by defining the range of allowed IP addresses",
|
|
1237
|
+
allowedIpRangeTitle: "Allowed IP range",
|
|
1238
|
+
ipStart: "IP start",
|
|
1239
|
+
ipEnd: "IP end",
|
|
1240
|
+
actions: "Actions",
|
|
1241
|
+
allowedIpRangeConfirmation: "This can't be undone. Confirm deletion of IP range {{ipStart}} to {{ipEnd}}",
|
|
1242
|
+
validations: {
|
|
1243
|
+
invalidIp: "Invalid IPv4 address format",
|
|
1244
|
+
ipEndGreaterThanIpStart: "IP end should be greater than or equal to IP start"
|
|
1245
|
+
},
|
|
1246
|
+
currentIpTitle: "Your current IP is",
|
|
1247
|
+
currentIpDescription: "Your current IP will be added to the allowed IP range by default. You will not be able to save the IP settings without your current IP address on the list"
|
|
1158
1248
|
}
|
|
1159
1249
|
};
|
|
1160
1250
|
var en = {
|
|
1251
|
+
generic: generic,
|
|
1252
|
+
authentication: authentication,
|
|
1253
|
+
authorization: authorization,
|
|
1254
|
+
resource: resource,
|
|
1255
|
+
otp: otp,
|
|
1256
|
+
upload: upload,
|
|
1257
|
+
image: image,
|
|
1258
|
+
userRole: userRole,
|
|
1259
|
+
activeRecord: activeRecord,
|
|
1260
|
+
sessions: sessions,
|
|
1261
|
+
payment: payment,
|
|
1262
|
+
invitations: invitations,
|
|
1263
|
+
github: github,
|
|
1161
1264
|
neetoCommons: neetoCommons
|
|
1162
1265
|
};
|
|
1163
1266
|
|
package/initializers.js
CHANGED
|
@@ -968,6 +968,81 @@ function initializeGlobalProps() {
|
|
|
968
968
|
deepFreezeObject(window.globalProps);
|
|
969
969
|
}
|
|
970
970
|
|
|
971
|
+
var generic = {
|
|
972
|
+
error: "Something went wrong. Please try again later."
|
|
973
|
+
};
|
|
974
|
+
var authentication = {
|
|
975
|
+
notLoggedIn: "Could not authenticate, please login to continue!",
|
|
976
|
+
couldNotAuth: "Could not authenticate with the provided %{parameter}.",
|
|
977
|
+
incorrectPassword: "Current password is incorrect. Please try again.",
|
|
978
|
+
incorrectEmailPassword: "Incorrect email or password. Please try again."
|
|
979
|
+
};
|
|
980
|
+
var authorization = {
|
|
981
|
+
unauthorized: "You are not authorized to perform this action."
|
|
982
|
+
};
|
|
983
|
+
var resource = {
|
|
984
|
+
add_one: "{{entity}} has been added successfully.",
|
|
985
|
+
add_other: "{{entity}} have been added successfully.",
|
|
986
|
+
save: "{{entity}} has been saved successfully.",
|
|
987
|
+
update: "{{entity}} has been updated successfully.",
|
|
988
|
+
delete_one: "{{entity}} has been deleted successfully.",
|
|
989
|
+
delete_other: "{{entity}} have been deleted successfully.",
|
|
990
|
+
clone: "{{entity}} has been cloned successfully.",
|
|
991
|
+
notFound: "{{entity}} does not exist.",
|
|
992
|
+
remove_one: "{{entity}} successfully removed",
|
|
993
|
+
remove_other: "{{entity}}s successfully removed",
|
|
994
|
+
sent: "{{entity}} sent successfully."
|
|
995
|
+
};
|
|
996
|
+
var otp = {
|
|
997
|
+
sent: "OTP has been sent successfully.",
|
|
998
|
+
invalid: "Invalid OTP",
|
|
999
|
+
verified: "OTP has been verified successfully."
|
|
1000
|
+
};
|
|
1001
|
+
var upload = {
|
|
1002
|
+
error: "An error occured while uploading the file"
|
|
1003
|
+
};
|
|
1004
|
+
var image = {
|
|
1005
|
+
profile: {
|
|
1006
|
+
removalFailed: "Failed to remove profile picture",
|
|
1007
|
+
removalSuccess: "Profile picture successfully removed"
|
|
1008
|
+
},
|
|
1009
|
+
contentTypeInvalid: "Other than jpg, png, svg are not supported",
|
|
1010
|
+
sizeOutOfRange: "Should not be more than {{maxSize, number}} MB"
|
|
1011
|
+
};
|
|
1012
|
+
var userRole = {
|
|
1013
|
+
deactivateActiveAdmin: "You cannot deactivate active admin from the organization!"
|
|
1014
|
+
};
|
|
1015
|
+
var activeRecord = {
|
|
1016
|
+
error: {
|
|
1017
|
+
blankName: "Name can't be blank",
|
|
1018
|
+
blankDescription: "Description can't be blank",
|
|
1019
|
+
blankValue: "Value can't be blank",
|
|
1020
|
+
prefixType: "Prefix type {{value}} is not valid",
|
|
1021
|
+
minimumEntryLimit: "Minimum entry limit must be less than or equal to {{maximumEntryLimit, number}}",
|
|
1022
|
+
maximumEntryLimit: "Maximum entry limit must be greater than or equal to {{minimumEntryLimit, number}}"
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
var sessions = {
|
|
1026
|
+
expiry: "Your session has expired. Please login again."
|
|
1027
|
+
};
|
|
1028
|
+
var payment = {
|
|
1029
|
+
error: {
|
|
1030
|
+
incomplete: "Your payment could not be completed"
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
var invitations = {
|
|
1034
|
+
deleted_one: "Invitation has been deleted successfully",
|
|
1035
|
+
deleted_other: "{{count, number}} Invitations have been deleted successfully",
|
|
1036
|
+
sent_one: "Invitation has been sent successfully",
|
|
1037
|
+
sent_other: "{{count, number}} Invitations have been sent successfully",
|
|
1038
|
+
notFound: "{{email}} was not invited to test this website."
|
|
1039
|
+
};
|
|
1040
|
+
var github = {
|
|
1041
|
+
error: {
|
|
1042
|
+
webhookPermissionDenied: "Permission denied. Ensure you have permission to create webhooks for the repository.",
|
|
1043
|
+
primaryNonDeletable: "Primary Github account cannot be deleted."
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
971
1046
|
var neetoCommons = {
|
|
972
1047
|
errorPage: {
|
|
973
1048
|
cantBeFound: "The page you're looking for <br /> can't be found.",
|
|
@@ -1143,9 +1218,37 @@ var neetoCommons = {
|
|
|
1143
1218
|
buttonLabel: "Contact us"
|
|
1144
1219
|
},
|
|
1145
1220
|
unknownBrowserMsg: "an unknown browser"
|
|
1221
|
+
},
|
|
1222
|
+
ipRestriction: {
|
|
1223
|
+
switchLabel: "Enable IP restriction",
|
|
1224
|
+
description: "Restrict access to only trusted locations and networks by defining the range of allowed IP addresses",
|
|
1225
|
+
allowedIpRangeTitle: "Allowed IP range",
|
|
1226
|
+
ipStart: "IP start",
|
|
1227
|
+
ipEnd: "IP end",
|
|
1228
|
+
actions: "Actions",
|
|
1229
|
+
allowedIpRangeConfirmation: "This can't be undone. Confirm deletion of IP range {{ipStart}} to {{ipEnd}}",
|
|
1230
|
+
validations: {
|
|
1231
|
+
invalidIp: "Invalid IPv4 address format",
|
|
1232
|
+
ipEndGreaterThanIpStart: "IP end should be greater than or equal to IP start"
|
|
1233
|
+
},
|
|
1234
|
+
currentIpTitle: "Your current IP is",
|
|
1235
|
+
currentIpDescription: "Your current IP will be added to the allowed IP range by default. You will not be able to save the IP settings without your current IP address on the list"
|
|
1146
1236
|
}
|
|
1147
1237
|
};
|
|
1148
1238
|
var en = {
|
|
1239
|
+
generic: generic,
|
|
1240
|
+
authentication: authentication,
|
|
1241
|
+
authorization: authorization,
|
|
1242
|
+
resource: resource,
|
|
1243
|
+
otp: otp,
|
|
1244
|
+
upload: upload,
|
|
1245
|
+
image: image,
|
|
1246
|
+
userRole: userRole,
|
|
1247
|
+
activeRecord: activeRecord,
|
|
1248
|
+
sessions: sessions,
|
|
1249
|
+
payment: payment,
|
|
1250
|
+
invitations: invitations,
|
|
1251
|
+
github: github,
|
|
1149
1252
|
neetoCommons: neetoCommons
|
|
1150
1253
|
};
|
|
1151
1254
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.25",
|
|
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>",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/preset-env": "^7.17.10",
|
|
48
48
|
"@babel/preset-react": "^7.16.7",
|
|
49
49
|
"@bigbinary/neeto-icons": "^1.8.35",
|
|
50
|
-
"@bigbinary/neetoui": "^4.1.
|
|
50
|
+
"@bigbinary/neetoui": "^4.1.33",
|
|
51
51
|
"@honeybadger-io/react": "2.0.1",
|
|
52
52
|
"@rollup/plugin-alias": "^3.1.9",
|
|
53
53
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"formik": "^2.2.9",
|
|
79
79
|
"husky": "^7.0.4",
|
|
80
80
|
"i18next": "21.7.0",
|
|
81
|
+
"ip-num": "^1.5.0",
|
|
81
82
|
"jest": "27.5.1",
|
|
82
83
|
"js-logger": "^1.6.1",
|
|
83
84
|
"lint-staged": "^12.3.7",
|