@undp/carbon-library 1.0.34 → 1.0.35
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/dist/cjs/index.js +21 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +21 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -4589,7 +4589,7 @@ antd.Select.Option;
|
|
4589
4589
|
var AddNewUserComponent = function (props) {
|
4590
4590
|
var _a, _b, _c, _d, _e, _f;
|
4591
4591
|
var t = props.t, onNavigateToUserManagement = props.onNavigateToUserManagement, onNavigateLogin = props.onNavigateLogin, useConnection = props.useConnection, useUserContext = props.useUserContext, useLocation = props.useLocation, useAbilityContext = props.useAbilityContext;
|
4592
|
-
var _g = useConnection(), post = _g.post, put = _g.put, del = _g.delete;
|
4592
|
+
var _g = useConnection(), post = _g.post, put = _g.put, del = _g.delete, get = _g.get;
|
4593
4593
|
var formOne = antd.Form.useForm()[0];
|
4594
4594
|
var state = useLocation().state;
|
4595
4595
|
var updateToken = useConnection().updateToken;
|
@@ -4603,6 +4603,24 @@ var AddNewUserComponent = function (props) {
|
|
4603
4603
|
var _p = React.useState(""), errorMsg = _p[0], setErrorMsg = _p[1];
|
4604
4604
|
var userInfoState = useUserContext().userInfoState;
|
4605
4605
|
var ability = useAbilityContext();
|
4606
|
+
var _q = React.useState([]), countries = _q[0], setCountries = _q[1];
|
4607
|
+
var getCountryList = function () { return __awaiter(void 0, void 0, void 0, function () {
|
4608
|
+
var response, alpha2Names;
|
4609
|
+
return __generator(this, function (_a) {
|
4610
|
+
switch (_a.label) {
|
4611
|
+
case 0: return [4 /*yield*/, get("national/organisation/countries")];
|
4612
|
+
case 1:
|
4613
|
+
response = _a.sent();
|
4614
|
+
if (response.data) {
|
4615
|
+
alpha2Names = response.data.map(function (item) {
|
4616
|
+
return item.alpha2;
|
4617
|
+
});
|
4618
|
+
setCountries(alpha2Names);
|
4619
|
+
}
|
4620
|
+
return [2 /*return*/];
|
4621
|
+
}
|
4622
|
+
});
|
4623
|
+
}); };
|
4606
4624
|
var onAddUser = function (values) { return __awaiter(void 0, void 0, void 0, function () {
|
4607
4625
|
var response, error_1;
|
4608
4626
|
return __generator(this, function (_a) {
|
@@ -4814,6 +4832,7 @@ var AddNewUserComponent = function (props) {
|
|
4814
4832
|
}); };
|
4815
4833
|
React.useEffect(function () {
|
4816
4834
|
console.log("state -- val --- ", __assign({}, state));
|
4835
|
+
getCountryList();
|
4817
4836
|
setIsUpdate((state === null || state === void 0 ? void 0 : state.record) ? true : false);
|
4818
4837
|
}, []);
|
4819
4838
|
return (React.createElement("div", { className: "add-user-main-container" },
|
@@ -4914,7 +4933,7 @@ var AddNewUserComponent = function (props) {
|
|
4914
4933
|
] },
|
4915
4934
|
React.createElement(PhoneInput, { placeholder: t("addUser:phoneNo"), international: true,
|
4916
4935
|
// value={contactNoInput}
|
4917
|
-
defaultCountry: "LK", countryCallingCodeEditable: false, onChange: function (v) { } }))))),
|
4936
|
+
defaultCountry: "LK", countryCallingCodeEditable: false, onChange: function (v) { }, countries: countries }))))),
|
4918
4937
|
React.createElement("div", { className: "actions" },
|
4919
4938
|
React.createElement(antd.Form.Item, null,
|
4920
4939
|
React.createElement("div", { className: "create-user-btn-container" },
|