@geowiki/ui 0.16.9-dev.14 → 0.16.9-dev.15
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.
|
@@ -20,8 +20,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
20
20
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
21
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
22
|
}) : x)(function(x) {
|
|
23
|
-
if (typeof require !== "undefined")
|
|
24
|
-
return require.apply(this, arguments);
|
|
23
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
25
24
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
26
25
|
});
|
|
27
26
|
var __objRest = (source, exclude) => {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__objRest,
|
|
4
4
|
__spreadProps,
|
|
5
5
|
__spreadValues
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IIIL7C6U.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/ClusterMap/cluster-map.tsx
|
|
9
9
|
import { MapContainer, TileLayer } from "react-leaflet";
|
|
@@ -90,10 +90,8 @@ var ClusterMarkers = (_props) => {
|
|
|
90
90
|
const { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = useConfigSettings();
|
|
91
91
|
const { data, error, isLoading } = useClusterMapInfo();
|
|
92
92
|
const fileUrl = useFileUrl();
|
|
93
|
-
if (error)
|
|
94
|
-
|
|
95
|
-
if (isLoading || IsConfigSettingsLoaded)
|
|
96
|
-
return /* @__PURE__ */ jsx2(LoaderFull, {});
|
|
93
|
+
if (error) return null;
|
|
94
|
+
if (isLoading || IsConfigSettingsLoaded) return /* @__PURE__ */ jsx2(LoaderFull, {});
|
|
97
95
|
if ((_b = (_a = ConfigSettings == null ? void 0 : ConfigSettings.ConfigSettings) == null ? void 0 : _a.FeaturesFarmerCluster) == null ? void 0 : _b.Text) {
|
|
98
96
|
return /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsx2(MarkerClusterGroup2, { children: data == null ? void 0 : data.map((cluster) => {
|
|
99
97
|
var _a2, _b2;
|
package/dist/index.js
CHANGED
|
@@ -174,10 +174,8 @@ var init_cluster_markers = __esm({
|
|
|
174
174
|
const { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core78.useConfigSettings)();
|
|
175
175
|
const { data, error, isLoading } = (0, import_core75.useClusterMapInfo)();
|
|
176
176
|
const fileUrl = (0, import_core77.useFileUrl)();
|
|
177
|
-
if (error)
|
|
178
|
-
|
|
179
|
-
if (isLoading || IsConfigSettingsLoaded)
|
|
180
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system62.LoaderFull, {});
|
|
177
|
+
if (error) return null;
|
|
178
|
+
if (isLoading || IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system62.LoaderFull, {});
|
|
181
179
|
if ((_b = (_a = ConfigSettings == null ? void 0 : ConfigSettings.ConfigSettings) == null ? void 0 : _a.FeaturesFarmerCluster) == null ? void 0 : _b.Text) {
|
|
182
180
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(MarkerClusterGroup2, { children: data == null ? void 0 : data.map((cluster) => {
|
|
183
181
|
var _a2, _b2;
|
|
@@ -295,8 +293,8 @@ var init_cluster_map = __esm({
|
|
|
295
293
|
});
|
|
296
294
|
|
|
297
295
|
// src/index.tsx
|
|
298
|
-
var
|
|
299
|
-
__export(
|
|
296
|
+
var index_exports = {};
|
|
297
|
+
__export(index_exports, {
|
|
300
298
|
AccountDetail: () => AccountDetail,
|
|
301
299
|
AddRole: () => AddRole,
|
|
302
300
|
AddTenant: () => AddTenant,
|
|
@@ -435,8 +433,8 @@ __export(src_exports, {
|
|
|
435
433
|
tableCustomStyles: () => tableCustomStyles,
|
|
436
434
|
tableDesigntyles: () => tableDesigntyles
|
|
437
435
|
});
|
|
438
|
-
module.exports = __toCommonJS(
|
|
439
|
-
__reExport(
|
|
436
|
+
module.exports = __toCommonJS(index_exports);
|
|
437
|
+
__reExport(index_exports, require("@geowiki/design-system"), module.exports);
|
|
440
438
|
|
|
441
439
|
// src/components/ui/footer.tsx
|
|
442
440
|
var import_core2 = require("@geowiki/core");
|
|
@@ -467,8 +465,7 @@ var NextImage = ({
|
|
|
467
465
|
var import_classnames = __toESM(require("classnames"));
|
|
468
466
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
469
467
|
var HtmlLinkList = ({ links }) => {
|
|
470
|
-
if (!links)
|
|
471
|
-
return null;
|
|
468
|
+
if (!links) return null;
|
|
472
469
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: links == null ? void 0 : links.map((link) => {
|
|
473
470
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
474
471
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -658,8 +655,7 @@ function parseTitle(title, type) {
|
|
|
658
655
|
return parsedTitle.join("");
|
|
659
656
|
}
|
|
660
657
|
var isAdmin = (token) => {
|
|
661
|
-
if (!token)
|
|
662
|
-
return false;
|
|
658
|
+
if (!token) return false;
|
|
663
659
|
try {
|
|
664
660
|
const decodedToken = (0, import_jwt_decode.jwtDecode)(token);
|
|
665
661
|
return decodedToken.role.includes(import_core4.USER_ROLE.ADMIN) || decodedToken.role.includes(import_core4.USER_ROLE.FARMER_CLUSTER_ADMIN);
|
|
@@ -1123,7 +1119,7 @@ var ProfileSettings = ({ data }) => {
|
|
|
1123
1119
|
const { handleSubmit, register } = (0, import_react_hook_form.useForm)();
|
|
1124
1120
|
const { toast: toast2 } = (0, import_design_system5.useToast)();
|
|
1125
1121
|
const queryClient = (0, import_react_query.useQueryClient)();
|
|
1126
|
-
const onSubmit = (data2) => __async(
|
|
1122
|
+
const onSubmit = (data2) => __async(null, null, function* () {
|
|
1127
1123
|
try {
|
|
1128
1124
|
yield import_api_proxy.ProfileService.profileUpdate(data2);
|
|
1129
1125
|
toast2({
|
|
@@ -1207,7 +1203,7 @@ var ChangePassword = () => {
|
|
|
1207
1203
|
newPassword: "",
|
|
1208
1204
|
confirmNewPassword: ""
|
|
1209
1205
|
});
|
|
1210
|
-
const onSubmit = (data) => __async(
|
|
1206
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
1211
1207
|
if (shouldDisabled()) {
|
|
1212
1208
|
toast2({
|
|
1213
1209
|
title: "Password Incorrect",
|
|
@@ -1324,7 +1320,7 @@ var AccountEdit = ({ data, open, setOpen }) => {
|
|
|
1324
1320
|
const handleInputChange = () => {
|
|
1325
1321
|
setShowSaving(false);
|
|
1326
1322
|
};
|
|
1327
|
-
const onSubmit = (data2) => __async(
|
|
1323
|
+
const onSubmit = (data2) => __async(null, null, function* () {
|
|
1328
1324
|
try {
|
|
1329
1325
|
yield import_api_proxy3.ProfileService.profileUpdate(data2);
|
|
1330
1326
|
toast2({
|
|
@@ -1575,7 +1571,7 @@ var PasswordEdit = ({ open, setOpen }) => {
|
|
|
1575
1571
|
setIsSaving(false);
|
|
1576
1572
|
}
|
|
1577
1573
|
}, [formValues, hasInteracted]);
|
|
1578
|
-
const onSubmit = (data) => __async(
|
|
1574
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
1579
1575
|
try {
|
|
1580
1576
|
setIsSaving(true);
|
|
1581
1577
|
const requestBody = data;
|
|
@@ -1861,7 +1857,7 @@ var TestEmail = ({ onDismiss }) => {
|
|
|
1861
1857
|
(0, import_react16.useEffect)(() => {
|
|
1862
1858
|
setOpen(true);
|
|
1863
1859
|
}, []);
|
|
1864
|
-
const onSubmit = (data) => __async(
|
|
1860
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
1865
1861
|
try {
|
|
1866
1862
|
const payload = data;
|
|
1867
1863
|
yield import_api_proxy5.EmailSettingsService.emailSettingsSendTestEmail(payload);
|
|
@@ -1950,7 +1946,7 @@ var Emailing = () => {
|
|
|
1950
1946
|
},
|
|
1951
1947
|
[emailSettingDto]
|
|
1952
1948
|
);
|
|
1953
|
-
const onSubmitEvent = () => __async(
|
|
1949
|
+
const onSubmitEvent = () => __async(null, null, function* () {
|
|
1954
1950
|
try {
|
|
1955
1951
|
yield import_api_proxy6.EmailSettingsService.emailSettingsUpdate(__spreadValues({}, emailSettingDto));
|
|
1956
1952
|
toast2({
|
|
@@ -2180,7 +2176,7 @@ var AddTenant = () => {
|
|
|
2180
2176
|
const { toast: toast2 } = (0, import_design_system21.useToast)();
|
|
2181
2177
|
const { handleSubmit, register } = (0, import_react_hook_form7.useForm)();
|
|
2182
2178
|
const queryClient = (0, import_react_query5.useQueryClient)();
|
|
2183
|
-
const onSubmit = (data) => __async(
|
|
2179
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
2184
2180
|
const newTenant = data;
|
|
2185
2181
|
try {
|
|
2186
2182
|
yield import_api_proxy7.TenantService.tenantCreate(newTenant);
|
|
@@ -2283,7 +2279,7 @@ var TenantEdit = ({
|
|
|
2283
2279
|
setEnableHost(true);
|
|
2284
2280
|
}
|
|
2285
2281
|
}, [tenantDto, (_a = tenantDto == null ? void 0 : tenantDto.extraProperties) == null ? void 0 : _a.Host]);
|
|
2286
|
-
const onSubmit = (dto) => __async(
|
|
2282
|
+
const onSubmit = (dto) => __async(null, null, function* () {
|
|
2287
2283
|
const tenant = dto;
|
|
2288
2284
|
try {
|
|
2289
2285
|
yield import_api_proxy8.TenantService.tenantUpdate(tenantId, tenant);
|
|
@@ -2429,7 +2425,7 @@ var FeatureList = ({ onDismiss, tenantId }) => {
|
|
|
2429
2425
|
setEnableEmailSetting(value);
|
|
2430
2426
|
}
|
|
2431
2427
|
};
|
|
2432
|
-
const onSubmit = () => __async(
|
|
2428
|
+
const onSubmit = () => __async(null, null, function* () {
|
|
2433
2429
|
try {
|
|
2434
2430
|
const featureUpdateDto = {};
|
|
2435
2431
|
featureUpdateDto.features = [
|
|
@@ -2463,7 +2459,7 @@ var FeatureList = ({ onDismiss, tenantId }) => {
|
|
|
2463
2459
|
}
|
|
2464
2460
|
}
|
|
2465
2461
|
});
|
|
2466
|
-
const onResetToDefaultEvent = () => __async(
|
|
2462
|
+
const onResetToDefaultEvent = () => __async(null, null, function* () {
|
|
2467
2463
|
try {
|
|
2468
2464
|
yield import_api_proxy9.FeaturesService.featuresDelete(import_core14.PermissionProvider.T, tenantId);
|
|
2469
2465
|
toast2({
|
|
@@ -2551,8 +2547,7 @@ var import_design_system24 = require("@geowiki/design-system");
|
|
|
2551
2547
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2552
2548
|
var PermissionActions = ({ actions }) => {
|
|
2553
2549
|
const renderElement = (action) => {
|
|
2554
|
-
if (!action.showButton || action.visible)
|
|
2555
|
-
return false;
|
|
2550
|
+
if (!action.showButton || action.visible) return false;
|
|
2556
2551
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_design_system24.DropdownMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_design_system24.Button, { variant: "secondary", onClick: action.callback, size: "sm", children: [
|
|
2557
2552
|
action.icon === "permission" && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
2558
2553
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
@@ -2631,7 +2626,7 @@ var DeleteTenant = ({
|
|
|
2631
2626
|
}) => {
|
|
2632
2627
|
const { toast: toast2 } = (0, import_design_system25.useToast)();
|
|
2633
2628
|
const [open, setOpen] = (0, import_react23.useState)(false);
|
|
2634
|
-
const onYesEvent = () => __async(
|
|
2629
|
+
const onYesEvent = () => __async(null, null, function* () {
|
|
2635
2630
|
try {
|
|
2636
2631
|
yield import_api_proxy10.TenantService.tenantDelete(tenantId);
|
|
2637
2632
|
toast2({
|
|
@@ -2823,7 +2818,7 @@ var AddUser = ({ showButtonAdd }) => {
|
|
|
2823
2818
|
const { toast: toast2 } = (0, import_design_system28.useToast)();
|
|
2824
2819
|
const queryClient = (0, import_react_query9.useQueryClient)();
|
|
2825
2820
|
const { handleSubmit, register } = (0, import_react_hook_form10.useForm)();
|
|
2826
|
-
const onSubmit = (data) => __async(
|
|
2821
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
2827
2822
|
const user = data;
|
|
2828
2823
|
user.isActive = isActive;
|
|
2829
2824
|
user.lockoutEnabled = lockoutEnabled;
|
|
@@ -2944,7 +2939,7 @@ var DeleteUser = ({
|
|
|
2944
2939
|
}) => {
|
|
2945
2940
|
const { toast: toast2 } = (0, import_design_system29.useToast)();
|
|
2946
2941
|
const [open, setOpen] = (0, import_react26.useState)(false);
|
|
2947
|
-
const onYesEvent = () => __async(
|
|
2942
|
+
const onYesEvent = () => __async(null, null, function* () {
|
|
2948
2943
|
try {
|
|
2949
2944
|
yield import_api_proxy12.UserService.userDelete(userId);
|
|
2950
2945
|
toast2({
|
|
@@ -3088,8 +3083,7 @@ function formatUserAlias(userName) {
|
|
|
3088
3083
|
var _a, _b;
|
|
3089
3084
|
const parts = userName.split("_");
|
|
3090
3085
|
const first = ((_b = (_a = parts[0].at(0)) == null ? void 0 : _a.toUpperCase()) != null ? _b : "") + parts[0].substring(1);
|
|
3091
|
-
if (!parts[1])
|
|
3092
|
-
return first;
|
|
3086
|
+
if (!parts[1]) return first;
|
|
3093
3087
|
return first + "(" + parts[1].toUpperCase() + ")";
|
|
3094
3088
|
}
|
|
3095
3089
|
var UserEdit = ({ userDto, userId, onDismiss }) => {
|
|
@@ -3153,20 +3147,16 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
|
|
|
3153
3147
|
setRefreshData(false);
|
|
3154
3148
|
};
|
|
3155
3149
|
if ((updateUserRoleProjectResult == null ? void 0 : updateUserRoleProjectResult.success) == true) {
|
|
3156
|
-
if (userAlias != "")
|
|
3157
|
-
|
|
3158
|
-
if (userProjectRole.length != 0)
|
|
3159
|
-
setUserProjectRole([]);
|
|
3150
|
+
if (userAlias != "") setUserAlias("");
|
|
3151
|
+
if (userProjectRole.length != 0) setUserProjectRole([]);
|
|
3160
3152
|
}
|
|
3161
3153
|
if (setUserDetail && setUserDetail.success == true) {
|
|
3162
|
-
if (contractStartDate != "")
|
|
3163
|
-
|
|
3164
|
-
if (contractEndDate != "")
|
|
3165
|
-
setContractEndDate("");
|
|
3154
|
+
if (contractStartDate != "") setContractStartDate("");
|
|
3155
|
+
if (contractEndDate != "") setContractEndDate("");
|
|
3166
3156
|
setUpdateUserDetail(false);
|
|
3167
3157
|
setRefreshData(false);
|
|
3168
3158
|
}
|
|
3169
|
-
const updateUserRoleProject = () => __async(
|
|
3159
|
+
const updateUserRoleProject = () => __async(null, null, function* () {
|
|
3170
3160
|
setUserAlias(formatUserAlias(userDto.userName));
|
|
3171
3161
|
setUpdateUserProject(true);
|
|
3172
3162
|
});
|
|
@@ -3216,17 +3206,14 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
|
|
|
3216
3206
|
const paginationComponentOptions = {
|
|
3217
3207
|
noRowsPerPage: true
|
|
3218
3208
|
};
|
|
3219
|
-
const onSubmit = (data) => __async(
|
|
3209
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
3220
3210
|
const user = data;
|
|
3221
3211
|
try {
|
|
3222
3212
|
if (evolandFeature) {
|
|
3223
|
-
if (!updateUserProject)
|
|
3224
|
-
yield updateUserRoleProject();
|
|
3213
|
+
if (!updateUserProject) yield updateUserRoleProject();
|
|
3225
3214
|
if (userCurrentProject && (userCurrentProject[0].contract_start_date != contractStartDate || userCurrentProject[0].contract_end_date != contractEndDate)) {
|
|
3226
|
-
if (contractStartDate == "")
|
|
3227
|
-
|
|
3228
|
-
if (contractEndDate == "")
|
|
3229
|
-
setContractEndDate(null);
|
|
3215
|
+
if (contractStartDate == "") setContractStartDate(null);
|
|
3216
|
+
if (contractEndDate == "") setContractEndDate(null);
|
|
3230
3217
|
if ((contractStartDate == "" || !contractStartDate) && contractEndDate || contractEndDate && contractStartDate && new Date(contractEndDate) < new Date(contractEndDate)) {
|
|
3231
3218
|
alert("Please provide correct date");
|
|
3232
3219
|
return;
|
|
@@ -3254,14 +3241,10 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
|
|
|
3254
3241
|
});
|
|
3255
3242
|
const onCloseEvent = () => {
|
|
3256
3243
|
setOpen(false);
|
|
3257
|
-
if (userAlias != "")
|
|
3258
|
-
|
|
3259
|
-
if (
|
|
3260
|
-
|
|
3261
|
-
if (contractStartDate != "")
|
|
3262
|
-
setContractStartDate("");
|
|
3263
|
-
if (contractEndDate != "")
|
|
3264
|
-
setContractEndDate("");
|
|
3244
|
+
if (userAlias != "") setUserAlias("");
|
|
3245
|
+
if (userProjectRole.length != 0) setUserProjectRole([]);
|
|
3246
|
+
if (contractStartDate != "") setContractStartDate("");
|
|
3247
|
+
if (contractEndDate != "") setContractEndDate("");
|
|
3265
3248
|
onDismiss();
|
|
3266
3249
|
};
|
|
3267
3250
|
(0, import_react28.useEffect)(() => {
|
|
@@ -3293,7 +3276,7 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
|
|
|
3293
3276
|
},
|
|
3294
3277
|
[roles]
|
|
3295
3278
|
);
|
|
3296
|
-
const onRoleAssignedSaveEvent = (e) => __async(
|
|
3279
|
+
const onRoleAssignedSaveEvent = (e) => __async(null, null, function* () {
|
|
3297
3280
|
var _a2;
|
|
3298
3281
|
e.preventDefault();
|
|
3299
3282
|
const updateUserDto = __spreadProps(__spreadValues({}, userDto), {
|
|
@@ -3378,8 +3361,7 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
|
|
|
3378
3361
|
onChange: (e) => {
|
|
3379
3362
|
if ((contractStartDate == "" || !contractStartDate) && e.target.value !== "" || new Date(contractStartDate) > new Date(e.target.value))
|
|
3380
3363
|
alert("Please provide correct start date");
|
|
3381
|
-
else
|
|
3382
|
-
setContractEndDate(e.target.value);
|
|
3364
|
+
else setContractEndDate(e.target.value);
|
|
3383
3365
|
}
|
|
3384
3366
|
})
|
|
3385
3367
|
)
|
|
@@ -3712,8 +3694,7 @@ var UserPermission = ({
|
|
|
3712
3694
|
var _a;
|
|
3713
3695
|
return (_a = g.permissions) == null ? void 0 : _a.every((p) => p.isGranted);
|
|
3714
3696
|
}).every((e) => e);
|
|
3715
|
-
if (hasAllPermissionGranted)
|
|
3716
|
-
setHasAllGranted(hasAllPermissionGranted);
|
|
3697
|
+
if (hasAllPermissionGranted) setHasAllGranted(hasAllPermissionGranted);
|
|
3717
3698
|
}
|
|
3718
3699
|
}, [permissionGroups]);
|
|
3719
3700
|
(0, import_react31.useEffect)(() => {
|
|
@@ -3777,7 +3758,7 @@ var UserPermission = ({
|
|
|
3777
3758
|
[hasAllGranted, permissionGroups]
|
|
3778
3759
|
);
|
|
3779
3760
|
const onSubmit = (0, import_react31.useCallback)(
|
|
3780
|
-
(e) => __async(
|
|
3761
|
+
(e) => __async(null, null, function* () {
|
|
3781
3762
|
e.preventDefault();
|
|
3782
3763
|
const payload = permissionGroups == null ? void 0 : permissionGroups.map(
|
|
3783
3764
|
(p) => p.permissions.map((grant) => ({
|
|
@@ -4123,7 +4104,7 @@ var DeleteRole = ({
|
|
|
4123
4104
|
}) => {
|
|
4124
4105
|
const { toast: toast2 } = (0, import_design_system41.useToast)();
|
|
4125
4106
|
const [open, setOpen] = (0, import_react33.useState)(false);
|
|
4126
|
-
const onYesEvent = () => __async(
|
|
4107
|
+
const onYesEvent = () => __async(null, null, function* () {
|
|
4127
4108
|
try {
|
|
4128
4109
|
yield import_api_proxy15.RoleService.roleDelete(roleId);
|
|
4129
4110
|
toast2({
|
|
@@ -4175,7 +4156,7 @@ var RoleEdit = ({ roleDto, roleId, onDismiss }) => {
|
|
|
4175
4156
|
const { handleSubmit, register } = (0, import_react_hook_form12.useForm)();
|
|
4176
4157
|
const [isDefault, setIsDefault] = (0, import_react34.useState)(roleDto.isDefault);
|
|
4177
4158
|
const [isPublic, setIsPublic] = (0, import_react34.useState)(roleDto.isPublic);
|
|
4178
|
-
const onSubmit = (data) => __async(
|
|
4159
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
4179
4160
|
const role = data;
|
|
4180
4161
|
role.isDefault = isDefault;
|
|
4181
4162
|
role.isPublic = isPublic;
|
|
@@ -4324,8 +4305,7 @@ var RolePermission = ({ roleDto, onDismiss }) => {
|
|
|
4324
4305
|
var _a;
|
|
4325
4306
|
return (_a = g.permissions) == null ? void 0 : _a.every((p) => p.isGranted);
|
|
4326
4307
|
}).every((e) => e);
|
|
4327
|
-
if (hasAllPermissionGranted)
|
|
4328
|
-
setHasAllGranted(hasAllPermissionGranted);
|
|
4308
|
+
if (hasAllPermissionGranted) setHasAllGranted(hasAllPermissionGranted);
|
|
4329
4309
|
}
|
|
4330
4310
|
}, [permissionGroups]);
|
|
4331
4311
|
(0, import_react35.useEffect)(() => {
|
|
@@ -4389,7 +4369,7 @@ var RolePermission = ({ roleDto, onDismiss }) => {
|
|
|
4389
4369
|
[hasAllGranted, permissionGroups]
|
|
4390
4370
|
);
|
|
4391
4371
|
const onSubmit = (0, import_react35.useCallback)(
|
|
4392
|
-
(e) => __async(
|
|
4372
|
+
(e) => __async(null, null, function* () {
|
|
4393
4373
|
e.preventDefault();
|
|
4394
4374
|
const payload = permissionGroups == null ? void 0 : permissionGroups.map(
|
|
4395
4375
|
(p) => p.permissions.map((grant) => ({
|
|
@@ -4698,7 +4678,7 @@ var AddRole = ({ showButtonAdd }) => {
|
|
|
4698
4678
|
const { toast: toast2 } = (0, import_design_system46.useToast)();
|
|
4699
4679
|
const { handleSubmit, register } = (0, import_react_hook_form13.useForm)();
|
|
4700
4680
|
const queryClient = (0, import_react_query14.useQueryClient)();
|
|
4701
|
-
const onSubmit = (data) => __async(
|
|
4681
|
+
const onSubmit = (data) => __async(null, null, function* () {
|
|
4702
4682
|
const newRole = data;
|
|
4703
4683
|
newRole.isDefault = isDefault;
|
|
4704
4684
|
newRole.isPublic = isPublic;
|
|
@@ -4910,13 +4890,11 @@ var import_core37 = require("@geowiki/core");
|
|
|
4910
4890
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4911
4891
|
var RequireRole = ({ roles, children }) => {
|
|
4912
4892
|
const currentUser = (0, import_core37.useCurrentUser)();
|
|
4913
|
-
if (!currentUser)
|
|
4914
|
-
return null;
|
|
4893
|
+
if (!currentUser) return null;
|
|
4915
4894
|
if (!(roles == null ? void 0 : roles.some((role) => {
|
|
4916
4895
|
var _a;
|
|
4917
4896
|
return (_a = currentUser.roles) == null ? void 0 : _a.includes(role);
|
|
4918
|
-
})))
|
|
4919
|
-
return null;
|
|
4897
|
+
}))) return null;
|
|
4920
4898
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children });
|
|
4921
4899
|
};
|
|
4922
4900
|
|
|
@@ -4987,8 +4965,7 @@ var Sidebar = ({
|
|
|
4987
4965
|
(menu) => {
|
|
4988
4966
|
var _a2;
|
|
4989
4967
|
const m = (_a2 = menu.children) == null ? void 0 : _a2.find((c) => c.link === (router == null ? void 0 : router.asPath));
|
|
4990
|
-
if (m)
|
|
4991
|
-
return menu.name;
|
|
4968
|
+
if (m) return menu.name;
|
|
4992
4969
|
return "";
|
|
4993
4970
|
},
|
|
4994
4971
|
[router == null ? void 0 : router.asPath]
|
|
@@ -5251,6 +5228,7 @@ var HtmlView = (props) => {
|
|
|
5251
5228
|
// src/components/Elements/TopProgress.tsx
|
|
5252
5229
|
var import_framer_motion = require("framer-motion");
|
|
5253
5230
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5231
|
+
var motion = import_framer_motion.motion;
|
|
5254
5232
|
var TopProgress = () => {
|
|
5255
5233
|
const { scrollYProgress } = (0, import_framer_motion.useScroll)();
|
|
5256
5234
|
const scaleX = (0, import_framer_motion.useSpring)(scrollYProgress, {
|
|
@@ -5258,7 +5236,7 @@ var TopProgress = () => {
|
|
|
5258
5236
|
damping: 30,
|
|
5259
5237
|
restDelta: 1e-3
|
|
5260
5238
|
});
|
|
5261
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(motion.div, { className: "progress-bar", style: { scaleX } }) });
|
|
5262
5240
|
};
|
|
5263
5241
|
|
|
5264
5242
|
// src/components/Elements/Pagination.tsx
|
|
@@ -5380,8 +5358,7 @@ var CustomDropDown = (props) => {
|
|
|
5380
5358
|
}
|
|
5381
5359
|
return null;
|
|
5382
5360
|
});
|
|
5383
|
-
if (IsConfigSettingsLoaded)
|
|
5384
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system52.LoaderFull, {});
|
|
5361
|
+
if (IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system52.LoaderFull, {});
|
|
5385
5362
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5386
5363
|
import_async.default,
|
|
5387
5364
|
{
|
|
@@ -5524,11 +5501,9 @@ var CustomFilterSort = (props) => {
|
|
|
5524
5501
|
LabelLookUp: item.LabelLookUp,
|
|
5525
5502
|
Parameter: item.Parameter,
|
|
5526
5503
|
onValueChange: (currentvalue) => {
|
|
5527
|
-
if ((currentvalue == null ? void 0 : currentvalue.value) != void 0)
|
|
5528
|
-
skip = 0;
|
|
5504
|
+
if ((currentvalue == null ? void 0 : currentvalue.value) != void 0) skip = 0;
|
|
5529
5505
|
filterValues[item == null ? void 0 : item.Name.replace(new RegExp(" ", "g"), "")] = currentvalue == null ? void 0 : currentvalue.value;
|
|
5530
|
-
if (!props.showButtons)
|
|
5531
|
-
onSearch();
|
|
5506
|
+
if (!props.showButtons) onSearch();
|
|
5532
5507
|
}
|
|
5533
5508
|
},
|
|
5534
5509
|
index
|
|
@@ -5596,13 +5571,13 @@ var import_framer_motion2 = require("framer-motion");
|
|
|
5596
5571
|
var import_core52 = require("@geowiki/core");
|
|
5597
5572
|
var import_design_system53 = require("@geowiki/design-system");
|
|
5598
5573
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5574
|
+
var motion2 = import_framer_motion2.motion;
|
|
5599
5575
|
var InfoCard = (props) => {
|
|
5600
5576
|
var _a;
|
|
5601
5577
|
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core50.useConfigSettings)();
|
|
5602
|
-
if (IsConfigSettingsLoaded)
|
|
5603
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system53.LoaderFull, {});
|
|
5578
|
+
if (IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_design_system53.LoaderFull, {});
|
|
5604
5579
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5605
|
-
|
|
5580
|
+
motion2.li,
|
|
5606
5581
|
{
|
|
5607
5582
|
className: "h-full lg:h-full flex flex-col cursor-pointer",
|
|
5608
5583
|
variants: import_core52.itemVariants,
|
|
@@ -5832,8 +5807,7 @@ var CmsImage = ({
|
|
|
5832
5807
|
showPlaceholder = true
|
|
5833
5808
|
}) => {
|
|
5834
5809
|
var { data: cmsImageUrl, isLoading } = (0, import_core56.useCmsImage)(src);
|
|
5835
|
-
if (isLoading)
|
|
5836
|
-
return null;
|
|
5810
|
+
if (isLoading) return null;
|
|
5837
5811
|
if (width && height) {
|
|
5838
5812
|
if (!showPlaceholder)
|
|
5839
5813
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
@@ -6536,8 +6510,8 @@ var RichTextContent = (props) => {
|
|
|
6536
6510
|
const [hasContent, setHasContent] = (0, import_react47.useState)(
|
|
6537
6511
|
props.defaultValue ? true : false
|
|
6538
6512
|
);
|
|
6539
|
-
const loadQuill = () => __async(
|
|
6540
|
-
return new Promise((resolve) => __async(
|
|
6513
|
+
const loadQuill = () => __async(null, null, function* () {
|
|
6514
|
+
return new Promise((resolve) => __async(null, null, function* () {
|
|
6541
6515
|
const Quill = yield require("react-quill").Quill;
|
|
6542
6516
|
const BlotFormatter = (yield require("quill-blot-formatter")).default;
|
|
6543
6517
|
resolve({ Quill, BlotFormatter });
|
|
@@ -6692,8 +6666,7 @@ var import_core64 = require("@geowiki/core");
|
|
|
6692
6666
|
var import_design_system58 = require("@geowiki/design-system");
|
|
6693
6667
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
6694
6668
|
var ButtonList = ({ data }) => {
|
|
6695
|
-
if (!data)
|
|
6696
|
-
return null;
|
|
6669
|
+
if (!data) return null;
|
|
6697
6670
|
return data == null ? void 0 : data.map((button) => {
|
|
6698
6671
|
var _a;
|
|
6699
6672
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system58.Button, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
@@ -6973,12 +6946,13 @@ var PublicationItem = ({ publication }) => {
|
|
|
6973
6946
|
|
|
6974
6947
|
// src/components/Publications/PublicationList.tsx
|
|
6975
6948
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6949
|
+
var motion7 = import_framer_motion7.motion;
|
|
6976
6950
|
var PublicationList = ({ publications }) => {
|
|
6977
6951
|
publications.sort((a, b) => {
|
|
6978
6952
|
return new Date(b.PublishedUtc).getTime() - new Date(a.PublishedUtc).getTime();
|
|
6979
6953
|
});
|
|
6980
6954
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6981
|
-
|
|
6955
|
+
motion7.ul,
|
|
6982
6956
|
{
|
|
6983
6957
|
className: "mx-auto mt-12 grid max-w-lg gap-5 lg:max-w-none lg:grid-cols-3",
|
|
6984
6958
|
initial: "initial",
|
|
@@ -7277,7 +7251,7 @@ var UpdatePassword = (props) => {
|
|
|
7277
7251
|
reset({ confirmnewPassword: null });
|
|
7278
7252
|
}
|
|
7279
7253
|
};
|
|
7280
|
-
const onPasswordSubmit = () => __async(
|
|
7254
|
+
const onPasswordSubmit = () => __async(null, null, function* () {
|
|
7281
7255
|
try {
|
|
7282
7256
|
yield import_api_proxy19.ProfileService.profileChangePassword(PasswordData);
|
|
7283
7257
|
import_sweetalert2.default.fire({
|
|
@@ -7480,7 +7454,7 @@ var UpdateUserProfile = ({
|
|
|
7480
7454
|
});
|
|
7481
7455
|
});
|
|
7482
7456
|
};
|
|
7483
|
-
const onProfileSubmit = () => __async(
|
|
7457
|
+
const onProfileSubmit = () => __async(null, null, function* () {
|
|
7484
7458
|
var result = yield import_api_proxy20.ProfileService.profileUpdate(UserData);
|
|
7485
7459
|
if (result.name === UserData.name && result.surname === UserData.surname) {
|
|
7486
7460
|
import_sweetalert22.default.fire({
|
|
@@ -7587,7 +7561,7 @@ var import_react_toastify = require("react-toastify");
|
|
|
7587
7561
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
7588
7562
|
var SettingsItem = (props) => {
|
|
7589
7563
|
const [value, setValue] = (0, import_react53.useState)(props.value);
|
|
7590
|
-
const handleUpdateSettings = () => __async(
|
|
7564
|
+
const handleUpdateSettings = () => __async(null, null, function* () {
|
|
7591
7565
|
try {
|
|
7592
7566
|
yield import_api_proxy21.SettingsService.settingsSetSettingForTenant(props.setting, value);
|
|
7593
7567
|
import_react_toastify.toast.success("Settings updated");
|
|
@@ -7633,8 +7607,7 @@ var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
|
7633
7607
|
var SettingsManagement = () => {
|
|
7634
7608
|
var _a;
|
|
7635
7609
|
var { data, isLoading } = (0, import_core81.useAppConfig)();
|
|
7636
|
-
if (isLoading)
|
|
7637
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: "Loading..." });
|
|
7610
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: "Loading..." });
|
|
7638
7611
|
const keys = Object == null ? void 0 : Object.keys((_a = data == null ? void 0 : data.setting) == null ? void 0 : _a.values);
|
|
7639
7612
|
let settings = {
|
|
7640
7613
|
GeoWiki: keys.filter((key) => key.startsWith("GeoWiki")),
|
|
@@ -7645,10 +7618,8 @@ var SettingsManagement = () => {
|
|
|
7645
7618
|
return key.startsWith((_a2 = data == null ? void 0 : data.currentTenant) == null ? void 0 : _a2.name);
|
|
7646
7619
|
})
|
|
7647
7620
|
};
|
|
7648
|
-
if (!data)
|
|
7649
|
-
|
|
7650
|
-
if (!keys)
|
|
7651
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: "no keys" });
|
|
7621
|
+
if (!data) return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: "no data" });
|
|
7622
|
+
if (!keys) return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: "no keys" });
|
|
7652
7623
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "w-full px-2 py-16 sm:px-0", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_react54.Tab.Group, { children: [
|
|
7653
7624
|
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_react54.Tab.List, { className: "flex p-1 space-x-1 rounded-xl", children: Object.keys(settings).map(
|
|
7654
7625
|
(key) => settings[key].length > 0 && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
@@ -8739,8 +8710,7 @@ var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
|
8739
8710
|
var ListTagsGroup = ({ cluster }) => {
|
|
8740
8711
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
8741
8712
|
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core90.useConfigSettings)();
|
|
8742
|
-
if (IsConfigSettingsLoaded)
|
|
8743
|
-
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_design_system80.LoaderFull, {});
|
|
8713
|
+
if (IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_design_system80.LoaderFull, {});
|
|
8744
8714
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "space-y-6 lg:space-y-10", children: [
|
|
8745
8715
|
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
8746
8716
|
import_design_system79.TagsGroup,
|
|
@@ -8908,8 +8878,7 @@ var ApiImage = ({
|
|
|
8908
8878
|
height = 0
|
|
8909
8879
|
}) => {
|
|
8910
8880
|
var { data, isLoading } = (0, import_core91.useApiImage)(imageId);
|
|
8911
|
-
if (isLoading)
|
|
8912
|
-
return null;
|
|
8881
|
+
if (isLoading) return null;
|
|
8913
8882
|
if (width > 0 && height > 0) {
|
|
8914
8883
|
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
8915
8884
|
import_core92.Image,
|
|
@@ -9674,10 +9643,8 @@ var ClusterNews = ({
|
|
|
9674
9643
|
path: clusterNewsItem.imageId === "00000000-0000-0000-0000-000000000000" ? "/assets/img/noImage.png" : clusterNewsItem.imageId
|
|
9675
9644
|
};
|
|
9676
9645
|
});
|
|
9677
|
-
if (isLoading)
|
|
9678
|
-
|
|
9679
|
-
if (publishedItems.length == 0)
|
|
9680
|
-
return null;
|
|
9646
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_design_system92.LocalLoader, {});
|
|
9647
|
+
if (publishedItems.length == 0) return null;
|
|
9681
9648
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_jsx_runtime115.Fragment, { children: !isLoading && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "bg-grey-lightest lg:mt-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "bg-grey-lightest mx-5 lg:mx-12", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "container mx-auto space-y-6 py-6 lg:space-y-10 lg:py-16 px-0 lg:px-10 ", children: [
|
|
9682
9649
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("div", { className: "lg:flex lg:justify-between lg:items-end", children: [
|
|
9683
9650
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_design_system90.H4Design, { className: "pb-4 lg:pb-0", children: "Cluster News" }),
|
|
@@ -9837,8 +9804,7 @@ var import_core105 = require("@geowiki/core");
|
|
|
9837
9804
|
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
9838
9805
|
var H3Clusters = ({ clusters }) => {
|
|
9839
9806
|
const { data: countries, isLoading: isCountriesLoading } = (0, import_core105.useCountries)();
|
|
9840
|
-
if (isCountriesLoading)
|
|
9841
|
-
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { children: "Loading..." });
|
|
9807
|
+
if (isCountriesLoading) return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { children: "Loading..." });
|
|
9842
9808
|
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "lg:container mx-auto space-y-6 lg:space-y-10 ", children: [
|
|
9843
9809
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "lg:flex lg:justify-between lg:items-end", children: [
|
|
9844
9810
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_design_system95.H4Design, { className: "pb-4 lg:pb-0", children: "Explore other Farmer Clusters" }),
|
|
@@ -10561,8 +10527,7 @@ var SubtitleH3Cluster4Column = ({
|
|
|
10561
10527
|
4
|
|
10562
10528
|
);
|
|
10563
10529
|
const { data: countries, isLoading: isCountriesLoading } = (0, import_core115.useCountries)();
|
|
10564
|
-
if (isClusterLoading || isCountriesLoading)
|
|
10565
|
-
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { children: "Loading..." });
|
|
10530
|
+
if (isClusterLoading || isCountriesLoading) return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { children: "Loading..." });
|
|
10566
10531
|
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
10567
10532
|
"div",
|
|
10568
10533
|
{
|