@geowiki/recodo 0.16.9-dev.2 → 0.16.9-dev.21
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/{cluster-map-LVG5YKOI.mjs → cluster-map-D24GOWM4.mjs} +7 -50
- package/dist/index.d.mts +3 -10
- package/dist/index.d.ts +3 -10
- package/dist/index.js +639 -720
- package/dist/index.mjs +383 -418
- package/dist/styles.css +1 -1
- package/package.json +42 -44
package/dist/index.js
CHANGED
|
@@ -30,94 +30,49 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// src/components/ClusterMap/MarkerClusterGroup.tsx
|
|
34
|
-
function getPropsAndEvents(props) {
|
|
35
|
-
let clusterProps = {};
|
|
36
|
-
let clusterEvents = {};
|
|
37
|
-
const { children, ...rest } = props;
|
|
38
|
-
Object.entries(rest).forEach(([propName, prop]) => {
|
|
39
|
-
if (propName.startsWith("on")) {
|
|
40
|
-
clusterEvents = { ...clusterEvents, [propName]: prop };
|
|
41
|
-
} else {
|
|
42
|
-
clusterProps = { ...clusterProps, [propName]: prop };
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return { clusterProps, clusterEvents };
|
|
46
|
-
}
|
|
47
|
-
function createMarkerClusterGroup(props, context) {
|
|
48
|
-
const { clusterProps, clusterEvents } = getPropsAndEvents(props);
|
|
49
|
-
const markerClusterGroup = new L.MarkerClusterGroup(clusterProps);
|
|
50
|
-
Object.entries(clusterEvents).forEach(([eventAsProp, callback]) => {
|
|
51
|
-
const clusterEvent = `cluster${eventAsProp.substring(2).toLowerCase()}`;
|
|
52
|
-
markerClusterGroup.on(clusterEvent, callback);
|
|
53
|
-
});
|
|
54
|
-
return (0, import_core12.createElementObject)(
|
|
55
|
-
markerClusterGroup,
|
|
56
|
-
(0, import_core12.extendContext)(context, { layerContainer: markerClusterGroup })
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
var import_core12, L, import_leaflet, updateMarkerCluster, MarkerClusterGroup2;
|
|
60
|
-
var init_MarkerClusterGroup = __esm({
|
|
61
|
-
"src/components/ClusterMap/MarkerClusterGroup.tsx"() {
|
|
62
|
-
"use strict";
|
|
63
|
-
"use client";
|
|
64
|
-
import_core12 = require("@react-leaflet/core");
|
|
65
|
-
L = __toESM(require("leaflet"));
|
|
66
|
-
import_leaflet = require("leaflet.markercluster");
|
|
67
|
-
updateMarkerCluster = () => {
|
|
68
|
-
};
|
|
69
|
-
MarkerClusterGroup2 = (0, import_core12.createPathComponent)(
|
|
70
|
-
createMarkerClusterGroup,
|
|
71
|
-
updateMarkerCluster
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
33
|
// src/components/ClusterMap/cluster-markers.tsx
|
|
77
34
|
function getIcon() {
|
|
78
35
|
const MyIcon = import_InformationCircleIcon.default;
|
|
79
36
|
return (0, import_server.renderToString)(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MyIcon, { height: 24, color: "black" }));
|
|
80
37
|
}
|
|
81
|
-
var
|
|
38
|
+
var import_leaflet, import_react_leaflet, import_core16, import_ui11, import_map, import_core17, import_core18, import_InformationCircleIcon, import_server, import_core19, import_jsx_runtime10, ClusterMarkers;
|
|
82
39
|
var init_cluster_markers = __esm({
|
|
83
40
|
"src/components/ClusterMap/cluster-markers.tsx"() {
|
|
84
41
|
"use strict";
|
|
85
42
|
"use client";
|
|
86
|
-
|
|
43
|
+
import_leaflet = require("leaflet");
|
|
87
44
|
import_react_leaflet = require("react-leaflet");
|
|
88
|
-
|
|
45
|
+
import_core16 = require("@geowiki/core");
|
|
89
46
|
import_ui11 = require("@geowiki/ui");
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
47
|
+
import_map = require("@geowiki/map");
|
|
48
|
+
import_core17 = require("@geowiki/core");
|
|
49
|
+
import_core18 = require("@geowiki/core");
|
|
93
50
|
import_InformationCircleIcon = __toESM(require("@heroicons/react/24/solid/InformationCircleIcon"));
|
|
94
51
|
import_server = require("react-dom/server");
|
|
95
|
-
|
|
52
|
+
import_core19 = require("@geowiki/core");
|
|
96
53
|
import_jsx_runtime10 = require("react/jsx-runtime");
|
|
97
54
|
ClusterMarkers = (_props) => {
|
|
98
|
-
const { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0,
|
|
99
|
-
const { data, error, isLoading } = (0,
|
|
100
|
-
const fileUrl = (0,
|
|
101
|
-
if (error)
|
|
102
|
-
|
|
103
|
-
if (isLoading || IsConfigSettingsLoaded)
|
|
104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui11.LoaderFull, {});
|
|
55
|
+
const { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core19.useConfigSettings)();
|
|
56
|
+
const { data, error, isLoading } = (0, import_core16.useClusterMapInfo)();
|
|
57
|
+
const fileUrl = (0, import_core18.useFileUrl)();
|
|
58
|
+
if (error) return null;
|
|
59
|
+
if (isLoading || IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ui11.LoaderFull, {});
|
|
105
60
|
if (ConfigSettings?.ConfigSettings?.FeaturesFarmerCluster?.Text) {
|
|
106
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_map.MarkerClusterGroup, { children: data?.map((cluster) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
107
62
|
import_react_leaflet.Marker,
|
|
108
63
|
{
|
|
109
|
-
icon: new
|
|
64
|
+
icon: new import_leaflet.DivIcon({
|
|
110
65
|
iconSize: [30, 30],
|
|
111
66
|
html: `<div class='marker-pin' style="background:#467327;"></div><i>${getIcon()}</i>`,
|
|
112
67
|
className: "custom-div-icon"
|
|
113
68
|
}),
|
|
114
|
-
position: cluster.location ? new
|
|
69
|
+
position: cluster.location ? new import_leaflet.LatLng(
|
|
115
70
|
cluster?.location?.latitude,
|
|
116
71
|
cluster?.location?.longitude
|
|
117
|
-
) : new
|
|
72
|
+
) : new import_leaflet.LatLng(0, 0),
|
|
118
73
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_leaflet.Popup, { maxWidth: 600, children: [
|
|
119
74
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-no-repeat bg-cover ripple shadow-lg rounded-lg mb-6 object-cover", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
120
|
-
|
|
75
|
+
import_core17.Image,
|
|
121
76
|
{
|
|
122
77
|
src: `${fileUrl}${cluster.coverImageId}`,
|
|
123
78
|
alt: "Image",
|
|
@@ -157,22 +112,22 @@ __export(cluster_map_exports, {
|
|
|
157
112
|
function getIcon2() {
|
|
158
113
|
return (0, import_server2.renderToString)(/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ui12.FarmerClusterPin, { height: 40, width: 40 }));
|
|
159
114
|
}
|
|
160
|
-
var import_react_leaflet2, import_leaflet3, import_leaflet4,
|
|
115
|
+
var import_react_leaflet2, import_leaflet2, import_leaflet3, import_leaflet4, import_server2, import_ui12, import_jsx_runtime11, centerLocation, icon, LocationMarker, FarmerClusterMap, cluster_map_default;
|
|
161
116
|
var init_cluster_map = __esm({
|
|
162
117
|
"src/components/ClusterMap/cluster-map.tsx"() {
|
|
163
118
|
"use strict";
|
|
164
119
|
"use client";
|
|
165
120
|
import_react_leaflet2 = require("react-leaflet");
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
121
|
+
import_leaflet2 = require("leaflet/dist/leaflet.css");
|
|
122
|
+
import_leaflet3 = require("leaflet");
|
|
123
|
+
import_leaflet4 = __toESM(require("leaflet"));
|
|
169
124
|
init_cluster_markers();
|
|
170
125
|
import_server2 = require("react-dom/server");
|
|
171
126
|
import_ui12 = require("@geowiki/ui");
|
|
172
127
|
import_jsx_runtime11 = require("react/jsx-runtime");
|
|
173
|
-
centerLocation = new
|
|
128
|
+
centerLocation = new import_leaflet3.LatLng(48.2082, 16.3738);
|
|
174
129
|
icon = () => {
|
|
175
|
-
return new
|
|
130
|
+
return new import_leaflet4.default.DivIcon({
|
|
176
131
|
iconSize: [40, 40],
|
|
177
132
|
iconAnchor: [28, 15],
|
|
178
133
|
html: `<i style="margin: 0px; margin-left: 7.5px; margin-top: -22px;">${getIcon2()}</i>`,
|
|
@@ -232,8 +187,8 @@ var init_cluster_map = __esm({
|
|
|
232
187
|
});
|
|
233
188
|
|
|
234
189
|
// src/index.tsx
|
|
235
|
-
var
|
|
236
|
-
__export(
|
|
190
|
+
var index_exports = {};
|
|
191
|
+
__export(index_exports, {
|
|
237
192
|
ClusterEditNews: () => ClusterEditNews,
|
|
238
193
|
ClusterNewsItem: () => ClusterNewsItem,
|
|
239
194
|
ClusterNewsList: () => ClusterNewsList,
|
|
@@ -260,7 +215,6 @@ __export(src_exports, {
|
|
|
260
215
|
ResourceIcon: () => ResourceIcon,
|
|
261
216
|
ResourceItem: () => ResourceItem,
|
|
262
217
|
ResourceList: () => ResourceList,
|
|
263
|
-
ResourceTag: () => ResourceTag,
|
|
264
218
|
ResourcesQuickFind: () => ResourcesQuickFind,
|
|
265
219
|
ResourcesSelectedTags: () => ResourcesSelectedTags,
|
|
266
220
|
SearchFilter: () => SearchFilter,
|
|
@@ -271,7 +225,7 @@ __export(src_exports, {
|
|
|
271
225
|
UserInfoPage: () => UserInfoPage,
|
|
272
226
|
ViewFarmerCluster: () => ViewFarmerCluster
|
|
273
227
|
});
|
|
274
|
-
module.exports = __toCommonJS(
|
|
228
|
+
module.exports = __toCommonJS(index_exports);
|
|
275
229
|
|
|
276
230
|
// src/components/FarmerCluster/ClusterNews/ClusterViewNews.tsx
|
|
277
231
|
var import_core = require("@geowiki/core");
|
|
@@ -287,8 +241,7 @@ var ClusterViewNews = (props) => {
|
|
|
287
241
|
props.clusterId,
|
|
288
242
|
props.newsId
|
|
289
243
|
);
|
|
290
|
-
if (isNewsLoading || isClusterLoading)
|
|
291
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.LoaderFull, {});
|
|
244
|
+
if (isNewsLoading || isClusterLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.LoaderFull, {});
|
|
292
245
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
293
246
|
import_ui.ClusterStoryItem,
|
|
294
247
|
{
|
|
@@ -315,15 +268,15 @@ var import_react5 = require("react");
|
|
|
315
268
|
var import_react_dropzone = require("react-dropzone");
|
|
316
269
|
var import_react_hook_form = require("react-hook-form");
|
|
317
270
|
var import_sweetalert2 = __toESM(require("sweetalert2"));
|
|
318
|
-
var import_core3 = require("@geowiki/core");
|
|
319
271
|
var import_core4 = require("@geowiki/core");
|
|
272
|
+
var import_core5 = require("@geowiki/core");
|
|
320
273
|
var import_ui4 = require("@geowiki/ui");
|
|
321
274
|
var import_ui5 = require("@geowiki/ui");
|
|
322
275
|
var import_ui6 = require("@geowiki/ui");
|
|
323
|
-
var import_router = require("next/router");
|
|
324
|
-
var import_core5 = require("@geowiki/core");
|
|
325
276
|
var import_core6 = require("@geowiki/core");
|
|
326
277
|
var import_core7 = require("@geowiki/core");
|
|
278
|
+
var import_core8 = require("@geowiki/core");
|
|
279
|
+
var import_core9 = require("@geowiki/core");
|
|
327
280
|
var import_api_proxy = require("@geowiki/api-proxy");
|
|
328
281
|
|
|
329
282
|
// src/components/FarmerCluster/ClusterNews/PreviewClusterNews.tsx
|
|
@@ -456,7 +409,7 @@ var import_react3 = require("@headlessui/react");
|
|
|
456
409
|
var import_react4 = require("react");
|
|
457
410
|
var import_outline2 = require("@heroicons/react/24/outline");
|
|
458
411
|
var import_ui3 = require("@geowiki/ui");
|
|
459
|
-
var
|
|
412
|
+
var import_core3 = require("@geowiki/core");
|
|
460
413
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
461
414
|
var FarmerClusterPopup = ({
|
|
462
415
|
title,
|
|
@@ -529,7 +482,7 @@ var FarmerClusterPopup = ({
|
|
|
529
482
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.H5Design, { className: "pt-2 pb-4 px-14", children: title }),
|
|
530
483
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Body16, { className: "px-24", children: description }),
|
|
531
484
|
clusterId && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
532
|
-
|
|
485
|
+
import_core3.Link,
|
|
533
486
|
{
|
|
534
487
|
href: `/cluster/view/${clusterId}`,
|
|
535
488
|
target: "_blank",
|
|
@@ -550,14 +503,14 @@ var FarmerClusterPopup = ({
|
|
|
550
503
|
// src/components/FarmerCluster/ClusterNews/ClusterEditNews.tsx
|
|
551
504
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
552
505
|
var ClusterEditNews = (props) => {
|
|
553
|
-
const router = (0,
|
|
506
|
+
const router = (0, import_core6.useRouter)();
|
|
554
507
|
const [showPreviewContent, setShowPreviewContent] = (0, import_react5.useState)(false);
|
|
555
508
|
const { id, clusterId } = router.query;
|
|
556
|
-
const { data: news, isLoading: isNewsLoading } = (0,
|
|
509
|
+
const { data: news, isLoading: isNewsLoading } = (0, import_core9.useClusterGetNews)(
|
|
557
510
|
props.clusterId,
|
|
558
511
|
props.newsId
|
|
559
512
|
);
|
|
560
|
-
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0,
|
|
513
|
+
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core7.useConfigSettings)();
|
|
561
514
|
const [title, setTitle] = (0, import_react5.useState)(news?.title);
|
|
562
515
|
const [summary, setSummary] = (0, import_react5.useState)(news?.intro);
|
|
563
516
|
const [imageId, setImageId] = (0, import_react5.useState)(news?.imageId);
|
|
@@ -575,7 +528,7 @@ var ClusterEditNews = (props) => {
|
|
|
575
528
|
)
|
|
576
529
|
);
|
|
577
530
|
};
|
|
578
|
-
const fileUrl = (0,
|
|
531
|
+
const fileUrl = (0, import_core8.useFileUrl)();
|
|
579
532
|
const {
|
|
580
533
|
register,
|
|
581
534
|
handleSubmit,
|
|
@@ -661,11 +614,10 @@ var ClusterEditNews = (props) => {
|
|
|
661
614
|
import_sweetalert2.default.fire("Failed", "Cluster News Update Failed", "error");
|
|
662
615
|
}
|
|
663
616
|
} catch (error) {
|
|
664
|
-
import_sweetalert2.default.fire("Failed",
|
|
617
|
+
import_sweetalert2.default.fire("Failed", import_core5.i18n.t(error), "error");
|
|
665
618
|
}
|
|
666
619
|
};
|
|
667
|
-
if (isNewsLoading || IsConfigSettingsLoaded)
|
|
668
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui6.LoaderFull, {});
|
|
620
|
+
if (isNewsLoading || IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui6.LoaderFull, {});
|
|
669
621
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
670
622
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("form", { className: "space-y-8 pt-5 ", onSubmit: handleSubmit(onSubmit), children: [
|
|
671
623
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "space-y-8", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
@@ -774,7 +726,7 @@ var ClusterEditNews = (props) => {
|
|
|
774
726
|
);
|
|
775
727
|
} else {
|
|
776
728
|
props.setRefresh(!props.refresh);
|
|
777
|
-
props.setStatus(
|
|
729
|
+
props.setStatus(import_core4.ViewStatus.List);
|
|
778
730
|
}
|
|
779
731
|
},
|
|
780
732
|
size: "sm",
|
|
@@ -834,14 +786,14 @@ var ClusterEditNews = (props) => {
|
|
|
834
786
|
|
|
835
787
|
// src/components/FarmerCluster/ClusterNews/ClusterNewsList.tsx
|
|
836
788
|
var import_react6 = require("react");
|
|
837
|
-
var
|
|
838
|
-
var
|
|
789
|
+
var import_core10 = require("@geowiki/core");
|
|
790
|
+
var import_core11 = require("@geowiki/core");
|
|
839
791
|
var import_react_data_table_component = __toESM(require("react-data-table-component"));
|
|
840
|
-
var
|
|
792
|
+
var import_core12 = require("@geowiki/core");
|
|
841
793
|
var import_ui7 = require("@geowiki/ui");
|
|
842
794
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
843
795
|
var ClusterNewsList = (props) => {
|
|
844
|
-
const { theme } = (0,
|
|
796
|
+
const { theme } = (0, import_core12.useTheme)();
|
|
845
797
|
const columns = [
|
|
846
798
|
{
|
|
847
799
|
name: "Post title",
|
|
@@ -894,7 +846,7 @@ var ClusterNewsList = (props) => {
|
|
|
894
846
|
const paginationComponentOptions = {
|
|
895
847
|
noRowsPerPage: true
|
|
896
848
|
};
|
|
897
|
-
const { data: AllNews, isLoading: IsAllNewsLoaded } = (0,
|
|
849
|
+
const { data: AllNews, isLoading: IsAllNewsLoaded } = (0, import_core11.useClusterAllNews)(
|
|
898
850
|
props.clusterId,
|
|
899
851
|
props.refresh,
|
|
900
852
|
void 0,
|
|
@@ -902,14 +854,13 @@ var ClusterNewsList = (props) => {
|
|
|
902
854
|
limitNews,
|
|
903
855
|
""
|
|
904
856
|
);
|
|
905
|
-
if (IsAllNewsLoaded)
|
|
906
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ui7.LoaderFull, {});
|
|
857
|
+
if (IsAllNewsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ui7.LoaderFull, {});
|
|
907
858
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
908
|
-
props.status ===
|
|
859
|
+
props.status === import_core10.ViewStatus.List ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "mt-3 sm:mt-3 sm:ml-4 flex ...", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
909
860
|
import_ui7.DesignButton,
|
|
910
861
|
{
|
|
911
862
|
size: "sm",
|
|
912
|
-
onClick: () => props.setStatus(
|
|
863
|
+
onClick: () => props.setStatus(import_core10.ViewStatus.New),
|
|
913
864
|
children: "Create new post"
|
|
914
865
|
}
|
|
915
866
|
) }) : null,
|
|
@@ -956,15 +907,13 @@ var ClusterNewsList = (props) => {
|
|
|
956
907
|
};
|
|
957
908
|
|
|
958
909
|
// src/components/FarmerCluster/ClusterNews/ClusterNewsItem.tsx
|
|
959
|
-
var
|
|
910
|
+
var import_core13 = require("@geowiki/core");
|
|
960
911
|
var import_ui8 = require("@geowiki/ui");
|
|
961
912
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
962
913
|
var ClusterNewsItem = ({ newsId }) => {
|
|
963
|
-
const { data, isLoading } = (0,
|
|
964
|
-
if (isLoading)
|
|
965
|
-
|
|
966
|
-
if (!data)
|
|
967
|
-
return null;
|
|
914
|
+
const { data, isLoading } = (0, import_core13.useClusterNewsWithId)(newsId);
|
|
915
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ui8.LoaderFull, {});
|
|
916
|
+
if (!data) return null;
|
|
968
917
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
969
918
|
import_ui8.ClusterStoryItem,
|
|
970
919
|
{
|
|
@@ -985,13 +934,13 @@ var ClusterNewsItem = ({ newsId }) => {
|
|
|
985
934
|
// src/components/FarmerCluster/FarmerClusterBasicInfo.tsx
|
|
986
935
|
var import_react9 = require("react");
|
|
987
936
|
var import_react_hook_form2 = require("react-hook-form");
|
|
988
|
-
var
|
|
937
|
+
var import_core20 = require("@geowiki/core");
|
|
989
938
|
var import_sweetalert22 = __toESM(require("sweetalert2"));
|
|
990
939
|
var import_ui13 = require("@geowiki/ui");
|
|
991
|
-
var
|
|
940
|
+
var import_core21 = require("@geowiki/core");
|
|
992
941
|
var import_api_proxy3 = require("@geowiki/api-proxy");
|
|
993
942
|
var import_ui14 = require("@geowiki/ui");
|
|
994
|
-
var
|
|
943
|
+
var import_core22 = require("@geowiki/core");
|
|
995
944
|
|
|
996
945
|
// src/components/FarmerCluster/SectionHeader.tsx
|
|
997
946
|
var import_ui9 = require("@geowiki/ui");
|
|
@@ -1183,14 +1132,14 @@ var import_date_fns = require("date-fns");
|
|
|
1183
1132
|
var import_react_dropzone2 = require("react-dropzone");
|
|
1184
1133
|
|
|
1185
1134
|
// src/components/RequireRecodoAdmin.tsx
|
|
1186
|
-
var
|
|
1135
|
+
var import_core14 = require("@geowiki/core");
|
|
1187
1136
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1188
1137
|
var RequireRecodoAdmin = ({
|
|
1189
1138
|
children
|
|
1190
1139
|
}) => {
|
|
1191
|
-
const { data } = (0,
|
|
1140
|
+
const { data } = (0, import_core14.useAppConfig)();
|
|
1192
1141
|
console.log(data?.currentUser?.roles);
|
|
1193
|
-
return data?.currentUser?.roles?.includes(
|
|
1142
|
+
return data?.currentUser?.roles?.includes(import_core14.USER_ROLE.FARMER_CLUSTER_ADMIN) || data?.currentUser?.roles?.includes(import_core14.USER_ROLE.ADMIN) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children }) : null;
|
|
1194
1143
|
};
|
|
1195
1144
|
|
|
1196
1145
|
// src/components/FarmerCluster/FarmerClusterBasicInfo.tsx
|
|
@@ -1200,11 +1149,11 @@ var import_react_query = require("@tanstack/react-query");
|
|
|
1200
1149
|
var import_react7 = require("@headlessui/react");
|
|
1201
1150
|
var import_react8 = require("react");
|
|
1202
1151
|
var import_ui10 = require("@geowiki/ui");
|
|
1203
|
-
var
|
|
1152
|
+
var import_core15 = require("@geowiki/core");
|
|
1204
1153
|
var import_outline3 = require("@heroicons/react/24/outline");
|
|
1205
1154
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1206
1155
|
var CancelPopup = ({ open, setOpen }) => {
|
|
1207
|
-
const router = (0,
|
|
1156
|
+
const router = (0, import_core15.useRouter)();
|
|
1208
1157
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.Transition.Root, { show: open, as: import_react8.Fragment, "data-component": "CancelPopup", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react7.Dialog, { as: "div", className: "relative z-10", onClose: setOpen, children: [
|
|
1209
1158
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1210
1159
|
import_react7.Transition.Child,
|
|
@@ -1289,15 +1238,15 @@ var CancelPopup = ({ open, setOpen }) => {
|
|
|
1289
1238
|
|
|
1290
1239
|
// src/components/FarmerCluster/FarmerClusterBasicInfo.tsx
|
|
1291
1240
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1292
|
-
var MapWithNoSSR = (0,
|
|
1241
|
+
var MapWithNoSSR = (0, import_core20.dynamic)(() => Promise.resolve().then(() => (init_cluster_map(), cluster_map_exports)), {
|
|
1293
1242
|
ssr: false
|
|
1294
1243
|
});
|
|
1295
1244
|
var FarmerClusterBasicInfo = () => {
|
|
1296
|
-
const router = (0,
|
|
1245
|
+
const router = (0, import_core22.useRouter)();
|
|
1297
1246
|
const id = router.query.id;
|
|
1298
1247
|
const mapRef = (0, import_react9.useRef)(null);
|
|
1299
|
-
const { data: countries, isLoading: isCountryLoading } = (0,
|
|
1300
|
-
const { data: cluster, isLoading } = (0,
|
|
1248
|
+
const { data: countries, isLoading: isCountryLoading } = (0, import_core21.useCountries)(true);
|
|
1249
|
+
const { data: cluster, isLoading } = (0, import_core21.useClusterDetails)(id);
|
|
1301
1250
|
const [coverImageId, setCoverImageId] = (0, import_react9.useState)(null);
|
|
1302
1251
|
const [selectedFileUrl, setSelectedFileUrl] = (0, import_react9.useState)(null);
|
|
1303
1252
|
const [selectedFile, setSelectedFile] = (0, import_react9.useState)(null);
|
|
@@ -1337,7 +1286,7 @@ var FarmerClusterBasicInfo = () => {
|
|
|
1337
1286
|
setCoverImageId(cluster?.coverImageId);
|
|
1338
1287
|
}, [cluster]);
|
|
1339
1288
|
(0, import_react9.useEffect)(() => {
|
|
1340
|
-
(0,
|
|
1289
|
+
(0, import_core21.scrollToFirstErrorElement)(errors);
|
|
1341
1290
|
}, [errors]);
|
|
1342
1291
|
const setClusterImage = async (file, clusterId) => {
|
|
1343
1292
|
return await import_api_proxy3.ClusterService.clusterSetCoverImage({
|
|
@@ -1381,7 +1330,7 @@ var FarmerClusterBasicInfo = () => {
|
|
|
1381
1330
|
createUpdateFarmerCluster
|
|
1382
1331
|
);
|
|
1383
1332
|
queryClient.invalidateQueries({
|
|
1384
|
-
queryKey: [
|
|
1333
|
+
queryKey: [import_core21.QueryNames.GetClusterDetails, id]
|
|
1385
1334
|
});
|
|
1386
1335
|
if (res !== null) {
|
|
1387
1336
|
setPopupOpen(true);
|
|
@@ -1389,8 +1338,7 @@ var FarmerClusterBasicInfo = () => {
|
|
|
1389
1338
|
import_sweetalert22.default.fire("Cluster update failed", "error");
|
|
1390
1339
|
}
|
|
1391
1340
|
};
|
|
1392
|
-
if (isCountryLoading || isLoading)
|
|
1393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui14.LoaderFull, {});
|
|
1341
|
+
if (isCountryLoading || isLoading) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui14.LoaderFull, {});
|
|
1394
1342
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative bg-white rounded-xl", children: [
|
|
1395
1343
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_hook_form2.FormProvider, { ...methods, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("form", { className: "space-y-4 py-8 px-6", onSubmit: handleSubmit(onSubmit), children: [
|
|
1396
1344
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
@@ -1552,7 +1500,7 @@ var FarmerClusterBasicInfo = () => {
|
|
|
1552
1500
|
defaultValue: field.value,
|
|
1553
1501
|
children: [
|
|
1554
1502
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui13.DesignSelectTrigger, { variant: "input", className: "pl-0", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui13.DesignSelectValue, { placeholder: "Activity Status" }) }),
|
|
1555
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui13.DesignSelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui13.DesignSelectGroup, { children:
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui13.DesignSelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ui13.DesignSelectGroup, { children: import_core21.CLUSTER_ACTIVITY_STATUS.map((activity) => {
|
|
1556
1504
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1557
1505
|
import_ui13.DesignSelectItem,
|
|
1558
1506
|
{
|
|
@@ -1807,11 +1755,11 @@ var import_react10 = require("react");
|
|
|
1807
1755
|
var import_react_hook_form4 = require("react-hook-form");
|
|
1808
1756
|
var import_sweetalert23 = __toESM(require("sweetalert2"));
|
|
1809
1757
|
var import_ui16 = require("@geowiki/ui");
|
|
1810
|
-
var
|
|
1811
|
-
var
|
|
1758
|
+
var import_core23 = require("@geowiki/core");
|
|
1759
|
+
var import_core24 = require("@geowiki/core");
|
|
1812
1760
|
var import_api_proxy4 = require("@geowiki/api-proxy");
|
|
1813
1761
|
var import_ui17 = require("@geowiki/ui");
|
|
1814
|
-
var
|
|
1762
|
+
var import_core25 = require("@geowiki/core");
|
|
1815
1763
|
|
|
1816
1764
|
// src/components/FarmerCluster/CharacteristicsSection.tsx
|
|
1817
1765
|
var import_react_hook_form3 = require("react-hook-form");
|
|
@@ -1898,15 +1846,15 @@ var import_zod3 = require("@hookform/resolvers/zod");
|
|
|
1898
1846
|
var import_react_query2 = require("@tanstack/react-query");
|
|
1899
1847
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1900
1848
|
var FarmerClusterDescription = () => {
|
|
1901
|
-
const router = (0,
|
|
1849
|
+
const router = (0, import_core25.useRouter)();
|
|
1902
1850
|
const id = router.query.id;
|
|
1903
1851
|
const [isSavedPopupOpen, setSavedPopupOpen] = (0, import_react10.useState)(false);
|
|
1904
1852
|
const [isCancelPopupOpen, setCancelPopupOpen] = (0, import_react10.useState)(false);
|
|
1905
|
-
const { data: cluster, isLoading: isClusterLoading } = (0,
|
|
1853
|
+
const { data: cluster, isLoading: isClusterLoading } = (0, import_core23.useClusterDescription)(
|
|
1906
1854
|
id
|
|
1907
1855
|
);
|
|
1908
1856
|
const queryClient = (0, import_react_query2.useQueryClient)();
|
|
1909
|
-
var { data: ConfigSettings, isLoading: isConfigLoading } = (0,
|
|
1857
|
+
var { data: ConfigSettings, isLoading: isConfigLoading } = (0, import_core24.useConfigSettings)();
|
|
1910
1858
|
const methods = (0, import_react_hook_form4.useForm)({
|
|
1911
1859
|
resolver: (0, import_zod3.zodResolver)(farmerClusterDescriptionDtoSchema),
|
|
1912
1860
|
defaultValues: {
|
|
@@ -1984,14 +1932,13 @@ var FarmerClusterDescription = () => {
|
|
|
1984
1932
|
if (res !== null) {
|
|
1985
1933
|
setSavedPopupOpen(true);
|
|
1986
1934
|
queryClient.invalidateQueries({
|
|
1987
|
-
queryKey: [
|
|
1935
|
+
queryKey: [import_core23.QueryNames.GetClusterDescription, id]
|
|
1988
1936
|
});
|
|
1989
1937
|
} else {
|
|
1990
1938
|
import_sweetalert23.default.fire("Cluster creation failed", "error");
|
|
1991
1939
|
}
|
|
1992
1940
|
};
|
|
1993
|
-
if (isConfigLoading || isClusterLoading)
|
|
1994
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui17.LoaderFull, {});
|
|
1941
|
+
if (isConfigLoading || isClusterLoading) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui17.LoaderFull, {});
|
|
1995
1942
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "relative bg-white rounded-xl", children: [
|
|
1996
1943
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_hook_form4.FormProvider, { ...methods, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "space-y-4 py-8 px-6", onSubmit: handleSubmit(onSubmit), children: [
|
|
1997
1944
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
@@ -2178,17 +2125,17 @@ var FarmerClusterDescription = () => {
|
|
|
2178
2125
|
var import_react14 = require("react");
|
|
2179
2126
|
var import_react_dropzone3 = require("react-dropzone");
|
|
2180
2127
|
var import_react_toastify2 = require("react-toastify");
|
|
2181
|
-
var
|
|
2128
|
+
var import_core27 = require("@geowiki/core");
|
|
2182
2129
|
var import_ui20 = require("@geowiki/ui");
|
|
2183
2130
|
var import_api_proxy6 = require("@geowiki/api-proxy");
|
|
2184
|
-
var
|
|
2131
|
+
var import_core28 = require("@geowiki/core");
|
|
2185
2132
|
var import_react_hook_form5 = require("react-hook-form");
|
|
2186
2133
|
var import_zod4 = require("@hookform/resolvers/zod");
|
|
2187
2134
|
var import_uuid = require("uuid");
|
|
2188
2135
|
|
|
2189
2136
|
// src/components/FarmerCluster/UpdateImageInfo.tsx
|
|
2190
2137
|
var import_api_proxy5 = require("@geowiki/api-proxy");
|
|
2191
|
-
var
|
|
2138
|
+
var import_core26 = require("@geowiki/core");
|
|
2192
2139
|
var import_ui18 = require("@geowiki/ui");
|
|
2193
2140
|
var import_react_query3 = require("@tanstack/react-query");
|
|
2194
2141
|
var import_react11 = require("react");
|
|
@@ -2213,7 +2160,7 @@ var UpdateImageInfo = ({
|
|
|
2213
2160
|
setOpen(false);
|
|
2214
2161
|
import_react_toastify.toast.success("Image info updated successfully");
|
|
2215
2162
|
queryClient.invalidateQueries({
|
|
2216
|
-
queryKey: [
|
|
2163
|
+
queryKey: [import_core26.QueryNames.GetImagesAndVideos, clusterId]
|
|
2217
2164
|
});
|
|
2218
2165
|
} else {
|
|
2219
2166
|
import_react_toastify.toast.error("Failed to update image info");
|
|
@@ -2368,9 +2315,9 @@ var AlertPopup = ({
|
|
|
2368
2315
|
// src/components/FarmerCluster/FarmerClusterImages.tsx
|
|
2369
2316
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2370
2317
|
var FarmerClusterImages = () => {
|
|
2371
|
-
const router = (0,
|
|
2318
|
+
const router = (0, import_core28.useRouter)();
|
|
2372
2319
|
const clusterId = router.query.id;
|
|
2373
|
-
const { data: filesData, isLoading } = (0,
|
|
2320
|
+
const { data: filesData, isLoading } = (0, import_core27.useClusterImagesAndVideos)(clusterId);
|
|
2374
2321
|
const [files, setFiles] = (0, import_react14.useState)([]);
|
|
2375
2322
|
const [isSavedPopupOpen, setSavedPopupOpen] = (0, import_react14.useState)(false);
|
|
2376
2323
|
const [isCancelPopupOpen, setCancelPopupOpen] = (0, import_react14.useState)(false);
|
|
@@ -2442,15 +2389,14 @@ var FarmerClusterImages = () => {
|
|
|
2442
2389
|
let newFiles = files.filter((x) => x.id !== imageId);
|
|
2443
2390
|
setFiles(newFiles);
|
|
2444
2391
|
queryClient.invalidateQueries({
|
|
2445
|
-
queryKey: [
|
|
2392
|
+
queryKey: [import_core27.QueryNames.GetImagesAndVideos, clusterId]
|
|
2446
2393
|
});
|
|
2447
2394
|
setAlertPopupOpen(false);
|
|
2448
2395
|
} catch (error) {
|
|
2449
2396
|
import_react_toastify2.toast.error("Image deleted failed");
|
|
2450
2397
|
}
|
|
2451
2398
|
};
|
|
2452
|
-
if (isLoading)
|
|
2453
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui20.LoaderFull, {});
|
|
2399
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui20.LoaderFull, {});
|
|
2454
2400
|
const onSubmit = handleSubmit(async (data) => {
|
|
2455
2401
|
setIsSaving(true);
|
|
2456
2402
|
let newlyAddedFiles = fileItems.filter((x) => x.isNew);
|
|
@@ -2476,7 +2422,7 @@ var FarmerClusterImages = () => {
|
|
|
2476
2422
|
setIsSaving(false);
|
|
2477
2423
|
setSavedPopupOpen(true);
|
|
2478
2424
|
queryClient.invalidateQueries({
|
|
2479
|
-
queryKey: [
|
|
2425
|
+
queryKey: [import_core27.QueryNames.GetImagesAndVideos, clusterId]
|
|
2480
2426
|
});
|
|
2481
2427
|
});
|
|
2482
2428
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_hook_form5.FormProvider, { ...methods, children: [
|
|
@@ -2669,30 +2615,30 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
2669
2615
|
// src/components/FarmerCluster/Farmers/FarmerRequests.tsx
|
|
2670
2616
|
var import_ui21 = require("@geowiki/ui");
|
|
2671
2617
|
var import_ui22 = require("@geowiki/ui");
|
|
2672
|
-
var
|
|
2673
|
-
var
|
|
2618
|
+
var import_core29 = require("@geowiki/core");
|
|
2619
|
+
var import_core30 = require("@geowiki/core");
|
|
2674
2620
|
var import_react_data_table_component2 = __toESM(require("react-data-table-component"));
|
|
2675
2621
|
var import_react_query5 = require("@tanstack/react-query");
|
|
2676
2622
|
var import_lucide_react = require("lucide-react");
|
|
2677
|
-
var
|
|
2623
|
+
var import_core31 = require("@geowiki/core");
|
|
2678
2624
|
var import_api_proxy7 = require("@geowiki/api-proxy");
|
|
2679
2625
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2680
2626
|
var FarmerRequests = (props) => {
|
|
2681
|
-
const { theme } = (0,
|
|
2627
|
+
const { theme } = (0, import_core30.useTheme)();
|
|
2682
2628
|
const queryClient = (0, import_react_query5.useQueryClient)();
|
|
2683
|
-
const { isLoading, isError, data } = (0,
|
|
2629
|
+
const { isLoading, isError, data } = (0, import_core31.useClusterGetJoinRequests)(
|
|
2684
2630
|
props.clusterId
|
|
2685
2631
|
);
|
|
2686
2632
|
const approve = async (id) => {
|
|
2687
2633
|
await import_api_proxy7.ClusterService.clusterApproveJoinRequests(id);
|
|
2688
2634
|
queryClient.invalidateQueries({
|
|
2689
|
-
queryKey: [
|
|
2635
|
+
queryKey: [import_core29.QueryNames.JoinRequests]
|
|
2690
2636
|
});
|
|
2691
2637
|
};
|
|
2692
2638
|
const reject = async (id) => {
|
|
2693
2639
|
await import_api_proxy7.ClusterService.clusterRejectJoinRequests(id);
|
|
2694
2640
|
queryClient.invalidateQueries({
|
|
2695
|
-
queryKey: [
|
|
2641
|
+
queryKey: [import_core29.QueryNames.JoinRequests]
|
|
2696
2642
|
});
|
|
2697
2643
|
};
|
|
2698
2644
|
const columns = [
|
|
@@ -2715,10 +2661,8 @@ var FarmerRequests = (props) => {
|
|
|
2715
2661
|
cell: (row) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "cursor-pointer p-2 rounded-lg hover:bg-slate-500", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react.XCircle, { size: 30, onClick: () => reject(row.id) }) })
|
|
2716
2662
|
}
|
|
2717
2663
|
];
|
|
2718
|
-
if (isLoading)
|
|
2719
|
-
|
|
2720
|
-
if (isError)
|
|
2721
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui21.ErrorMessage, {});
|
|
2664
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui22.LoaderFull, {});
|
|
2665
|
+
if (isError) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui21.ErrorMessage, {});
|
|
2722
2666
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-8", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2723
2667
|
import_react_data_table_component2.default,
|
|
2724
2668
|
{
|
|
@@ -2774,22 +2718,22 @@ var FarmerClusterMembers = (props) => {
|
|
|
2774
2718
|
|
|
2775
2719
|
// src/components/FarmerCluster/FarmerClusterNews.tsx
|
|
2776
2720
|
var import_react17 = require("react");
|
|
2777
|
-
var
|
|
2721
|
+
var import_core37 = require("@geowiki/core");
|
|
2778
2722
|
|
|
2779
2723
|
// src/components/FarmerCluster/ClusterNews/ClusterCreateNews.tsx
|
|
2780
2724
|
var import_react16 = require("react");
|
|
2781
2725
|
var import_react_dropzone4 = require("react-dropzone");
|
|
2782
2726
|
var import_react_hook_form6 = require("react-hook-form");
|
|
2783
2727
|
var import_sweetalert24 = __toESM(require("sweetalert2"));
|
|
2784
|
-
var
|
|
2728
|
+
var import_core32 = require("@geowiki/core");
|
|
2785
2729
|
var import_ui23 = require("@geowiki/ui");
|
|
2786
2730
|
var import_ui24 = require("@geowiki/ui");
|
|
2787
|
-
var
|
|
2788
|
-
var
|
|
2789
|
-
var
|
|
2731
|
+
var import_core33 = require("@geowiki/core");
|
|
2732
|
+
var import_core34 = require("@geowiki/core");
|
|
2733
|
+
var import_core35 = require("@geowiki/core");
|
|
2790
2734
|
var import_api_proxy8 = require("@geowiki/api-proxy");
|
|
2791
2735
|
var import_ui25 = require("@geowiki/ui");
|
|
2792
|
-
var
|
|
2736
|
+
var import_core36 = require("@geowiki/core");
|
|
2793
2737
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2794
2738
|
var ClusterCreateNews = (props) => {
|
|
2795
2739
|
const {
|
|
@@ -2800,18 +2744,18 @@ var ClusterCreateNews = (props) => {
|
|
|
2800
2744
|
const state = {
|
|
2801
2745
|
button: "Draft"
|
|
2802
2746
|
};
|
|
2803
|
-
var session = (0,
|
|
2747
|
+
var session = (0, import_core35.useSession)();
|
|
2804
2748
|
const [value, setValue] = (0, import_react16.useState)("");
|
|
2805
2749
|
const [coverImage, setCoverImage] = (0, import_react16.useState)();
|
|
2806
2750
|
const [files, setFiles] = (0, import_react16.useState)([]);
|
|
2807
2751
|
const [showPreviewContent, setShowPreviewContent] = (0, import_react16.useState)(false);
|
|
2808
2752
|
const [openSevedPopup, setOpenSevedPopup] = (0, import_react16.useState)(false);
|
|
2809
2753
|
const [textPopup, setTextPopup] = (0, import_react16.useState)("");
|
|
2810
|
-
const { data: uploadFile } = (0,
|
|
2811
|
-
const { data: cluster, isLoading: isClusterLoading } = (0,
|
|
2754
|
+
const { data: uploadFile } = (0, import_core32.useFileUpload)({ files });
|
|
2755
|
+
const { data: cluster, isLoading: isClusterLoading } = (0, import_core36.useCluster)(
|
|
2812
2756
|
props.clusterId
|
|
2813
2757
|
);
|
|
2814
|
-
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0,
|
|
2758
|
+
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core34.useConfigSettings)();
|
|
2815
2759
|
const [title, setTitle] = (0, import_react16.useState)("");
|
|
2816
2760
|
const [summary, setSummary] = (0, import_react16.useState)("");
|
|
2817
2761
|
const [imagePath, setImagePath] = (0, import_react16.useState)("");
|
|
@@ -2985,7 +2929,7 @@ var ClusterCreateNews = (props) => {
|
|
|
2985
2929
|
import_ui23.DesignButton,
|
|
2986
2930
|
{
|
|
2987
2931
|
onClick: () => {
|
|
2988
|
-
props.setStatus(
|
|
2932
|
+
props.setStatus(import_core33.ViewStatus.List);
|
|
2989
2933
|
props.setRefresh(!props.refresh);
|
|
2990
2934
|
},
|
|
2991
2935
|
type: "button",
|
|
@@ -3055,7 +2999,7 @@ var ClusterCreateNews_default = ClusterCreateNews;
|
|
|
3055
2999
|
var import_api_proxy9 = require("@geowiki/api-proxy");
|
|
3056
3000
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3057
3001
|
var FarmerClusterNews = (props) => {
|
|
3058
|
-
const [status, setStatus] = (0, import_react17.useState)(
|
|
3002
|
+
const [status, setStatus] = (0, import_react17.useState)(import_core37.ViewStatus.List);
|
|
3059
3003
|
const [refresh, setRefresh] = (0, import_react17.useState)(true);
|
|
3060
3004
|
const [newToEdit, setNewToEdit] = (0, import_react17.useState)("");
|
|
3061
3005
|
const [newsToView] = (0, import_react17.useState)("");
|
|
@@ -3064,7 +3008,7 @@ var FarmerClusterNews = (props) => {
|
|
|
3064
3008
|
const [deleteNewsName, setDeleteNewsName] = (0, import_react17.useState)("");
|
|
3065
3009
|
const onEdit = (row) => {
|
|
3066
3010
|
setNewToEdit(row?.id);
|
|
3067
|
-
setStatus(
|
|
3011
|
+
setStatus(import_core37.ViewStatus.Edit);
|
|
3068
3012
|
setRefresh(!refresh);
|
|
3069
3013
|
window.scroll({
|
|
3070
3014
|
top: 0,
|
|
@@ -3081,7 +3025,7 @@ var FarmerClusterNews = (props) => {
|
|
|
3081
3025
|
if (currentData) {
|
|
3082
3026
|
try {
|
|
3083
3027
|
await import_api_proxy9.ClusterService.clusterDeleteNews(props.clusterId, data.id);
|
|
3084
|
-
setStatus(
|
|
3028
|
+
setStatus(import_core37.ViewStatus.List);
|
|
3085
3029
|
setRefresh(!refresh);
|
|
3086
3030
|
setShowAlert(false);
|
|
3087
3031
|
} catch {
|
|
@@ -3095,7 +3039,7 @@ var FarmerClusterNews = (props) => {
|
|
|
3095
3039
|
};
|
|
3096
3040
|
const renderView = (status2) => {
|
|
3097
3041
|
switch (status2) {
|
|
3098
|
-
case
|
|
3042
|
+
case import_core37.ViewStatus.New:
|
|
3099
3043
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3100
3044
|
ClusterCreateNews_default,
|
|
3101
3045
|
{
|
|
@@ -3107,7 +3051,7 @@ var FarmerClusterNews = (props) => {
|
|
|
3107
3051
|
setRefresh
|
|
3108
3052
|
}
|
|
3109
3053
|
);
|
|
3110
|
-
case
|
|
3054
|
+
case import_core37.ViewStatus.Edit:
|
|
3111
3055
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3112
3056
|
ClusterEditNews,
|
|
3113
3057
|
{
|
|
@@ -3120,7 +3064,7 @@ var FarmerClusterNews = (props) => {
|
|
|
3120
3064
|
setRefresh
|
|
3121
3065
|
}
|
|
3122
3066
|
);
|
|
3123
|
-
case
|
|
3067
|
+
case import_core37.ViewStatus.List:
|
|
3124
3068
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
3125
3069
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3126
3070
|
ClusterNewsList,
|
|
@@ -3146,7 +3090,7 @@ var FarmerClusterNews = (props) => {
|
|
|
3146
3090
|
}
|
|
3147
3091
|
)
|
|
3148
3092
|
] });
|
|
3149
|
-
case
|
|
3093
|
+
case import_core37.ViewStatus.View:
|
|
3150
3094
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3151
3095
|
ClusterViewNews,
|
|
3152
3096
|
{
|
|
@@ -3164,23 +3108,23 @@ var FarmerClusterNews = (props) => {
|
|
|
3164
3108
|
// src/components/FarmerCluster/FarmerClusterList.tsx
|
|
3165
3109
|
var import_react18 = require("react");
|
|
3166
3110
|
var import_sweetalert25 = __toESM(require("sweetalert2"));
|
|
3167
|
-
var
|
|
3111
|
+
var import_core38 = require("@geowiki/core");
|
|
3168
3112
|
var import_ui26 = require("@geowiki/ui");
|
|
3169
3113
|
var import_ui27 = require("@geowiki/ui");
|
|
3170
|
-
var
|
|
3171
|
-
var
|
|
3114
|
+
var import_core39 = require("@geowiki/core");
|
|
3115
|
+
var import_core40 = require("@geowiki/core");
|
|
3172
3116
|
var import_api_proxy10 = require("@geowiki/api-proxy");
|
|
3173
3117
|
var import_ui28 = require("@geowiki/ui");
|
|
3174
3118
|
var import_react_query6 = require("@tanstack/react-query");
|
|
3175
|
-
var
|
|
3119
|
+
var import_core41 = require("@geowiki/core");
|
|
3176
3120
|
var import_react_data_table_component3 = __toESM(require("react-data-table-component"));
|
|
3177
|
-
var
|
|
3121
|
+
var import_core42 = require("@geowiki/core");
|
|
3178
3122
|
var import_ui29 = require("@geowiki/ui");
|
|
3179
3123
|
var import_ui30 = require("@geowiki/ui");
|
|
3180
3124
|
var import_ui31 = require("@geowiki/ui");
|
|
3181
3125
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3182
3126
|
var FarmerClusterList = () => {
|
|
3183
|
-
const { theme } = (0,
|
|
3127
|
+
const { theme } = (0, import_core42.useTheme)();
|
|
3184
3128
|
const queryClient = (0, import_react_query6.useQueryClient)();
|
|
3185
3129
|
var [skip, setSkip] = (0, import_react18.useState)(0);
|
|
3186
3130
|
var [limit, setLimit] = (0, import_react18.useState)(10);
|
|
@@ -3190,7 +3134,7 @@ var FarmerClusterList = () => {
|
|
|
3190
3134
|
const [clusterIdToDelete, setClusterIdToDelete] = (0, import_react18.useState)(
|
|
3191
3135
|
null
|
|
3192
3136
|
);
|
|
3193
|
-
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0,
|
|
3137
|
+
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core38.useConfigSettings)();
|
|
3194
3138
|
var farmerClusterEnabled = ConfigSettings?.ConfigSettings?.FeaturesFarmerCluster?.Text;
|
|
3195
3139
|
var canViewFarmerClusterPermission = ConfigSettings?.PermissionFarmerCluster?.ContentItems?.filter(
|
|
3196
3140
|
(permission) => permission.KeyValueItem?.Key?.Text == "Default"
|
|
@@ -3208,7 +3152,7 @@ var FarmerClusterList = () => {
|
|
|
3208
3152
|
const handlePerRowsChange = async (newPerPage, _page) => {
|
|
3209
3153
|
setLimit(newPerPage);
|
|
3210
3154
|
};
|
|
3211
|
-
const { data, isLoading } = (0,
|
|
3155
|
+
const { data, isLoading } = (0, import_core40.useClusters)(false, "", skip, limit);
|
|
3212
3156
|
const columns = [
|
|
3213
3157
|
{
|
|
3214
3158
|
name: "Name",
|
|
@@ -3258,7 +3202,7 @@ var FarmerClusterList = () => {
|
|
|
3258
3202
|
try {
|
|
3259
3203
|
await import_api_proxy10.ClusterService.clusterDelete(clusterIdToDelete);
|
|
3260
3204
|
queryClient.invalidateQueries({
|
|
3261
|
-
queryKey: [
|
|
3205
|
+
queryKey: [import_core41.QueryNames.Clusters]
|
|
3262
3206
|
});
|
|
3263
3207
|
setAlertOpen(false);
|
|
3264
3208
|
} catch {
|
|
@@ -3267,18 +3211,15 @@ var FarmerClusterList = () => {
|
|
|
3267
3211
|
}
|
|
3268
3212
|
}
|
|
3269
3213
|
};
|
|
3270
|
-
if (isLoading || IsConfigSettingsLoaded)
|
|
3271
|
-
|
|
3272
|
-
if (!
|
|
3273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui27.FeatureDisabled, {});
|
|
3274
|
-
if (!canViewFarmerClusterPermission)
|
|
3275
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui26.PermissionDisabled, {});
|
|
3214
|
+
if (isLoading || IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui28.LoaderFull, {});
|
|
3215
|
+
if (!farmerClusterEnabled) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui27.FeatureDisabled, {});
|
|
3216
|
+
if (!canViewFarmerClusterPermission) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui26.PermissionDisabled, {});
|
|
3276
3217
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
3277
3218
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "container mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pb-8 mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "pb-5", children: [
|
|
3278
3219
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "-ml-4 -mt-2 pb-8 items-center sm:flex-nowrap", children: [
|
|
3279
3220
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "ml-4 mt-2 text-2xl lg:text-[1.75rem] font-semibold leading-[120%]", children: "Farmer Clusters" }),
|
|
3280
3221
|
canCreateFarmerClusterPermission ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "ml-4 pt-6 flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3281
|
-
|
|
3222
|
+
import_core39.Link,
|
|
3282
3223
|
{
|
|
3283
3224
|
href: "/admin/cluster/create",
|
|
3284
3225
|
className: "btn btn-primary m-0",
|
|
@@ -3357,14 +3298,13 @@ var import_ui33 = require("@geowiki/ui");
|
|
|
3357
3298
|
var import_ui34 = require("@geowiki/ui");
|
|
3358
3299
|
var import_react_player = __toESM(require("react-player"));
|
|
3359
3300
|
var import_ui35 = require("@geowiki/ui");
|
|
3360
|
-
var
|
|
3301
|
+
var import_core43 = require("@geowiki/core");
|
|
3361
3302
|
var import_ui36 = require("@geowiki/ui");
|
|
3362
3303
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3363
3304
|
var ViewBasicInfo = ({ cluster }) => {
|
|
3364
3305
|
var arrayPos = 0;
|
|
3365
|
-
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0,
|
|
3366
|
-
if (IsConfigSettingsLoaded)
|
|
3367
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ui35.LoaderFull, {});
|
|
3306
|
+
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core43.useConfigSettings)();
|
|
3307
|
+
if (IsConfigSettingsLoaded) return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ui35.LoaderFull, {});
|
|
3368
3308
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "container mx-auto pt-4", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("section", { className: "px-2 py-5", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "shadow ", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "border-t px-2 py-5", children: [
|
|
3369
3309
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("dl", { className: "grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-3", children: [
|
|
3370
3310
|
cluster?.activityStatus != null && cluster?.activityStatus !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -3557,25 +3497,24 @@ var ViewClusterImagesList_default = ViewClusterImagesList;
|
|
|
3557
3497
|
|
|
3558
3498
|
// src/components/FarmerCluster/ViewFarmerCluster.tsx
|
|
3559
3499
|
var import_ui38 = require("@geowiki/ui");
|
|
3560
|
-
var
|
|
3561
|
-
var
|
|
3562
|
-
var
|
|
3563
|
-
var
|
|
3500
|
+
var import_core44 = require("@geowiki/core");
|
|
3501
|
+
var import_core45 = require("@geowiki/core");
|
|
3502
|
+
var import_core46 = require("@geowiki/core");
|
|
3503
|
+
var import_core47 = require("@geowiki/core");
|
|
3564
3504
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3565
3505
|
var ViewFarmerCluster = ({ cluster }) => {
|
|
3566
|
-
const { data: appData } = (0,
|
|
3567
|
-
const fileUrl = (0,
|
|
3568
|
-
const router = (0,
|
|
3506
|
+
const { data: appData } = (0, import_core46.useAppConfig)();
|
|
3507
|
+
const fileUrl = (0, import_core47.useFileUrl)();
|
|
3508
|
+
const router = (0, import_core45.useRouter)();
|
|
3569
3509
|
const [route, setRoute] = (0, import_react19.useState)(null);
|
|
3570
|
-
const MapWithNoSSR3 = (0,
|
|
3510
|
+
const MapWithNoSSR3 = (0, import_core44.dynamic)(() => Promise.resolve().then(() => (init_cluster_map(), cluster_map_exports)), {
|
|
3571
3511
|
ssr: false
|
|
3572
3512
|
});
|
|
3573
3513
|
var position = {
|
|
3574
3514
|
lat: cluster?.location?.latitude,
|
|
3575
3515
|
lng: cluster?.location?.longitude
|
|
3576
3516
|
};
|
|
3577
|
-
if (!cluster)
|
|
3578
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { children: "Cluster not found" });
|
|
3517
|
+
if (!cluster) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { children: "Cluster not found" });
|
|
3579
3518
|
var news = cluster?.clusterNews?.filter((x) => x.status == "Publish")?.map((news2) => ({
|
|
3580
3519
|
id: news2["id"],
|
|
3581
3520
|
url: appData?.currentUser?.id == cluster?.creatorId ? "/cluster/" + cluster.id + "/news/" + news2["id"] + "?view=edit" : "/cluster/" + cluster.id + "/news/" + news2["id"],
|
|
@@ -3709,15 +3648,15 @@ var ViewFarmerCluster = ({ cluster }) => {
|
|
|
3709
3648
|
};
|
|
3710
3649
|
|
|
3711
3650
|
// src/components/FarmerCluster/FarmerClusterFinder.tsx
|
|
3712
|
-
var
|
|
3651
|
+
var import_core48 = require("@geowiki/core");
|
|
3713
3652
|
var import_ui39 = require("@geowiki/ui");
|
|
3714
3653
|
var import_outline5 = require("@heroicons/react/24/outline");
|
|
3715
|
-
var
|
|
3654
|
+
var import_core49 = require("@geowiki/core");
|
|
3716
3655
|
var import_uuid2 = require("uuid");
|
|
3717
3656
|
var import_react20 = require("react");
|
|
3718
3657
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3719
3658
|
var FarmerClusterFinder = () => {
|
|
3720
|
-
const router = (0,
|
|
3659
|
+
const router = (0, import_core49.useRouter)();
|
|
3721
3660
|
const currentPage = parseInt(router.query.page) || 1;
|
|
3722
3661
|
const mainCrop = router.query.mainCrop;
|
|
3723
3662
|
const farmingSystem = router.query.farmingSystem;
|
|
@@ -3736,8 +3675,8 @@ var FarmerClusterFinder = () => {
|
|
|
3736
3675
|
mainAgriculturalAreas,
|
|
3737
3676
|
sort
|
|
3738
3677
|
};
|
|
3739
|
-
const { data: clusters, isLoading } = (0,
|
|
3740
|
-
const { data: countries, isLoading: isCountriesLoading } = (0,
|
|
3678
|
+
const { data: clusters, isLoading } = (0, import_core48.useFilterClusters)(filter);
|
|
3679
|
+
const { data: countries, isLoading: isCountriesLoading } = (0, import_core48.useCountries)();
|
|
3741
3680
|
const [isFilterPopupOpen, setIsFilterPopupOpen] = (0, import_react20.useState)(false);
|
|
3742
3681
|
const [isSortPopupOpen, setIsSortPopupOpen] = (0, import_react20.useState)(false);
|
|
3743
3682
|
const [namePopup, setNamePopup] = (0, import_react20.useState)("");
|
|
@@ -3776,17 +3715,17 @@ var FarmerClusterFinder = () => {
|
|
|
3776
3715
|
{
|
|
3777
3716
|
filterName: "Farming System",
|
|
3778
3717
|
routerFiltername: "farmingSystem",
|
|
3779
|
-
filterItems:
|
|
3718
|
+
filterItems: import_core48.FarmingSystem
|
|
3780
3719
|
},
|
|
3781
3720
|
{
|
|
3782
3721
|
filterName: "Main Crops",
|
|
3783
3722
|
routerFiltername: "mainCrop",
|
|
3784
|
-
filterItems:
|
|
3723
|
+
filterItems: import_core48.MainCrops
|
|
3785
3724
|
},
|
|
3786
3725
|
{
|
|
3787
3726
|
filterName: "Main Agricultural Areas",
|
|
3788
3727
|
routerFiltername: "mainAgriculturalAreas",
|
|
3789
|
-
filterItems:
|
|
3728
|
+
filterItems: import_core48.MainAgriculturalAreas
|
|
3790
3729
|
}
|
|
3791
3730
|
];
|
|
3792
3731
|
const sortingTypes = [
|
|
@@ -3844,7 +3783,7 @@ var FarmerClusterFinder = () => {
|
|
|
3844
3783
|
},
|
|
3845
3784
|
children: [
|
|
3846
3785
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectTrigger, { className: "w-72 lg:w-60", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectValue, { placeholder: "Farming Systems" }) }),
|
|
3847
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectContent, { className: "max-w-[92vw] lg:max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectGroup, { children:
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectContent, { className: "max-w-[92vw] lg:max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectGroup, { children: import_core48.FarmingSystem?.map((farming, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectItem, { value: farming.value, children: farming.label }, index)) }) })
|
|
3848
3787
|
]
|
|
3849
3788
|
},
|
|
3850
3789
|
(router.query.farmingSystem ? router.query.farmingSystem : void 0)?.toString()
|
|
@@ -3864,7 +3803,7 @@ var FarmerClusterFinder = () => {
|
|
|
3864
3803
|
},
|
|
3865
3804
|
children: [
|
|
3866
3805
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectTrigger, { className: "w-72", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectValue, { placeholder: "Main Agricultural Areas" }) }),
|
|
3867
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectContent, { className: "max-w-[92vw] lg:max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectGroup, { children:
|
|
3806
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectContent, { className: "max-w-[92vw] lg:max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectGroup, { children: import_core48.MainAgriculturalAreas?.map((agriculturalAreas, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectItem, { value: agriculturalAreas.value, children: agriculturalAreas.label }, index)) }) })
|
|
3868
3807
|
]
|
|
3869
3808
|
},
|
|
3870
3809
|
(router.query.mainAgriculturalAreas ? router.query.mainAgriculturalAreas : void 0)?.toString()
|
|
@@ -3884,7 +3823,7 @@ var FarmerClusterFinder = () => {
|
|
|
3884
3823
|
},
|
|
3885
3824
|
children: [
|
|
3886
3825
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectTrigger, { className: "w-72 lg:w-44", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectValue, { placeholder: "Main Crop" }) }),
|
|
3887
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectContent, { className: "max-w-[92vw] lg:max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectGroup, { children:
|
|
3826
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectContent, { className: "max-w-[92vw] lg:max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectGroup, { children: import_core48.MainCrops?.map((crop, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui39.DesignSelectItem, { value: crop.value, children: crop.label }, index)) }) })
|
|
3888
3827
|
]
|
|
3889
3828
|
},
|
|
3890
3829
|
(router.query.mainCrop ? router.query.mainCrop : void 0)?.toString()
|
|
@@ -3924,7 +3863,7 @@ var FarmerClusterFinder = () => {
|
|
|
3924
3863
|
selectedFarmingSystem && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3925
3864
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { children: [
|
|
3926
3865
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "font-medium", children: "Farming System " }),
|
|
3927
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children:
|
|
3866
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: import_core48.FarmingSystem.find((x) => x.value == selectedFarmingSystem)?.label })
|
|
3928
3867
|
] }),
|
|
3929
3868
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3930
3869
|
import_outline5.XCircleIcon,
|
|
@@ -3937,7 +3876,7 @@ var FarmerClusterFinder = () => {
|
|
|
3937
3876
|
selectedMainCrop && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3938
3877
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { children: [
|
|
3939
3878
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "font-medium", children: "Main Crop " }),
|
|
3940
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children:
|
|
3879
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: import_core48.MainCrops.find((x) => x.value == selectedMainCrop)?.label })
|
|
3941
3880
|
] }),
|
|
3942
3881
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3943
3882
|
import_outline5.XCircleIcon,
|
|
@@ -3950,7 +3889,7 @@ var FarmerClusterFinder = () => {
|
|
|
3950
3889
|
selectedMainAgriculturalAreas && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3951
3890
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { children: [
|
|
3952
3891
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "font-medium", children: "Main Agricultural Areas " }),
|
|
3953
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children:
|
|
3892
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: import_core48.MainAgriculturalAreas.find(
|
|
3954
3893
|
(x) => x.value == selectedMainAgriculturalAreas
|
|
3955
3894
|
)?.label })
|
|
3956
3895
|
] }),
|
|
@@ -3990,9 +3929,9 @@ var FarmerClusterFinder = () => {
|
|
|
3990
3929
|
|
|
3991
3930
|
// src/components/FarmerCluster/RecodoViewFarmerCluster.tsx
|
|
3992
3931
|
var import_react25 = require("react");
|
|
3993
|
-
var
|
|
3932
|
+
var import_core51 = require("@geowiki/core");
|
|
3994
3933
|
var import_api_proxy12 = require("@geowiki/api-proxy");
|
|
3995
|
-
var
|
|
3934
|
+
var import_core52 = require("@geowiki/core");
|
|
3996
3935
|
var import_ui42 = require("@geowiki/ui");
|
|
3997
3936
|
var import_react_player2 = __toESM(require("react-player"));
|
|
3998
3937
|
|
|
@@ -4002,7 +3941,7 @@ var import_api_proxy11 = require("@geowiki/api-proxy");
|
|
|
4002
3941
|
var import_react22 = require("@headlessui/react");
|
|
4003
3942
|
var import_outline6 = require("@heroicons/react/24/outline");
|
|
4004
3943
|
var import_react23 = require("react");
|
|
4005
|
-
var
|
|
3944
|
+
var import_core50 = require("@geowiki/core");
|
|
4006
3945
|
var import_react_hook_form7 = require("react-hook-form");
|
|
4007
3946
|
var import_ui40 = require("@geowiki/ui");
|
|
4008
3947
|
var import_ui41 = require("@geowiki/ui");
|
|
@@ -4020,12 +3959,12 @@ var FarmerClusterContactForm = ({
|
|
|
4020
3959
|
const handleCheckboxChange = () => {
|
|
4021
3960
|
setIsChecked(!isChecked);
|
|
4022
3961
|
};
|
|
4023
|
-
const { data: hosts } = (0,
|
|
3962
|
+
const { data: hosts } = (0, import_core50.useHosts)();
|
|
4024
3963
|
const { register, handleSubmit } = (0, import_react_hook_form7.useForm)();
|
|
4025
3964
|
const onSubmit = async (formData) => {
|
|
4026
3965
|
setOpenSending(true);
|
|
4027
|
-
var tenantInfo =
|
|
4028
|
-
var tenantName =
|
|
3966
|
+
var tenantInfo = import_core50.HostService.getCurrentHostInfo(hosts || []);
|
|
3967
|
+
var tenantName = import_core50.HostService.getTenantName(tenantInfo);
|
|
4029
3968
|
var subjectPrefix = "";
|
|
4030
3969
|
if (tenantName) {
|
|
4031
3970
|
subjectPrefix = tenantName + " - ";
|
|
@@ -4213,18 +4152,17 @@ var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
|
4213
4152
|
var RecodoViewFarmerCluster = ({
|
|
4214
4153
|
cluster
|
|
4215
4154
|
}) => {
|
|
4216
|
-
const router = (0,
|
|
4155
|
+
const router = (0, import_core52.useRouter)();
|
|
4217
4156
|
const [route, setRoute] = (0, import_react25.useState)(null);
|
|
4218
4157
|
const [openContact, setOpenContact] = (0, import_react25.useState)(false);
|
|
4219
|
-
const MapWithNoSSR3 = (0,
|
|
4158
|
+
const MapWithNoSSR3 = (0, import_core51.dynamic)(() => Promise.resolve().then(() => (init_cluster_map(), cluster_map_exports)), {
|
|
4220
4159
|
ssr: false
|
|
4221
4160
|
});
|
|
4222
4161
|
var position = {
|
|
4223
4162
|
lat: cluster?.location?.latitude,
|
|
4224
4163
|
lng: cluster?.location?.longitude
|
|
4225
4164
|
};
|
|
4226
|
-
if (!cluster)
|
|
4227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: "Cluster not found" });
|
|
4165
|
+
if (!cluster) return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: "Cluster not found" });
|
|
4228
4166
|
if (cluster && route == null)
|
|
4229
4167
|
setRoute([
|
|
4230
4168
|
{ path: router.asPath, name: "View Farmer Cluster - " + cluster?.name }
|
|
@@ -4395,7 +4333,7 @@ var RecodoViewFarmerCluster = ({
|
|
|
4395
4333
|
|
|
4396
4334
|
// src/components/FarmerCluster/ResourcesQuickFind.tsx
|
|
4397
4335
|
var import_ui47 = require("@geowiki/ui");
|
|
4398
|
-
var
|
|
4336
|
+
var import_core58 = require("@geowiki/core");
|
|
4399
4337
|
var import_react29 = require("react");
|
|
4400
4338
|
|
|
4401
4339
|
// src/components/Resource/ResourceLink.tsx
|
|
@@ -4405,11 +4343,11 @@ var import_react28 = require("react");
|
|
|
4405
4343
|
var import_react26 = require("react");
|
|
4406
4344
|
var import_react27 = require("@headlessui/react");
|
|
4407
4345
|
var import_outline7 = require("@heroicons/react/24/outline");
|
|
4408
|
-
var
|
|
4409
|
-
var
|
|
4410
|
-
var
|
|
4411
|
-
var
|
|
4412
|
-
var
|
|
4346
|
+
var import_core53 = require("@geowiki/core");
|
|
4347
|
+
var import_core54 = require("@geowiki/core");
|
|
4348
|
+
var import_core55 = require("@geowiki/core");
|
|
4349
|
+
var import_core56 = require("@geowiki/core");
|
|
4350
|
+
var import_core57 = require("@geowiki/core");
|
|
4413
4351
|
|
|
4414
4352
|
// src/components/Resource/ResourceIcon.tsx
|
|
4415
4353
|
var import_ui43 = require("@geowiki/ui");
|
|
@@ -4461,44 +4399,20 @@ var ResourceIcon = ({
|
|
|
4461
4399
|
}
|
|
4462
4400
|
};
|
|
4463
4401
|
|
|
4464
|
-
// src/components/Resource/ResourceTag.tsx
|
|
4465
|
-
var import_ui44 = require("@geowiki/ui");
|
|
4466
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
4467
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4468
|
-
var tagVariants = (0, import_class_variance_authority.cva)(
|
|
4469
|
-
"justify-center self-start px-4 py-2 mr-2 mt-1 text-sm font-medium text-white whitespace-nowrap rounded-[40px] first-letter:capitalize",
|
|
4470
|
-
{
|
|
4471
|
-
variants: {
|
|
4472
|
-
variant: {
|
|
4473
|
-
topic: "bg-tag-dark-blue",
|
|
4474
|
-
audience: "bg-tag-dark-green",
|
|
4475
|
-
keyword: "bg-tag-blue",
|
|
4476
|
-
language: "bg-tag-orange",
|
|
4477
|
-
resourceType: "bg-sky-500"
|
|
4478
|
-
}
|
|
4479
|
-
},
|
|
4480
|
-
defaultVariants: {
|
|
4481
|
-
variant: "topic"
|
|
4482
|
-
}
|
|
4483
|
-
}
|
|
4484
|
-
);
|
|
4485
|
-
var ResourceTag = ({ tag, type }) => {
|
|
4486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: (0, import_ui44.cn)(tagVariants({ variant: type })), children: tag });
|
|
4487
|
-
};
|
|
4488
|
-
|
|
4489
4402
|
// src/components/Resource/ResourceView.tsx
|
|
4403
|
+
var import_ui44 = require("@geowiki/ui");
|
|
4490
4404
|
var import_ui45 = require("@geowiki/ui");
|
|
4491
|
-
var
|
|
4405
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4492
4406
|
var DetailRow = ({ label, value }) => {
|
|
4493
|
-
return /* @__PURE__ */ (0,
|
|
4494
|
-
/* @__PURE__ */ (0,
|
|
4495
|
-
/* @__PURE__ */ (0,
|
|
4407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex gap-2 lg:gap-5 lg:justify-between py-4 max-md:flex-wrap max-md:max-w-full lg:py-6 border-0 border-b border-grey-light", children: [
|
|
4408
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.Body16, { className: "text-grey", children: label }),
|
|
4409
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.Body16m, { className: "lg:text-righ max-md:max-w-full", children: value })
|
|
4496
4410
|
] }) });
|
|
4497
4411
|
};
|
|
4498
4412
|
var KeyValues = ({ name, keyValues, kind }) => {
|
|
4499
|
-
return /* @__PURE__ */ (0,
|
|
4500
|
-
/* @__PURE__ */ (0,
|
|
4501
|
-
/* @__PURE__ */ (0,
|
|
4413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
4414
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.Caption, { className: "text-grey", children: name }),
|
|
4415
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center flex-wrap text-sm font-medium whitespace-nowrap mt-2 mb-6 lg:mt-4 lg:mb-10", children: keyValues.map((keyValue, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui44.ResourceTag, { tag: keyValue.value, type: kind }, index)) })
|
|
4502
4416
|
] });
|
|
4503
4417
|
};
|
|
4504
4418
|
function ResourceView({
|
|
@@ -4509,10 +4423,10 @@ function ResourceView({
|
|
|
4509
4423
|
selectedAudience,
|
|
4510
4424
|
selectedTopic
|
|
4511
4425
|
}) {
|
|
4512
|
-
const { data: audiences } = (0,
|
|
4513
|
-
const { data: topics } = (0,
|
|
4514
|
-
const { data: types } = (0,
|
|
4515
|
-
const { data: languages } = (0,
|
|
4426
|
+
const { data: audiences } = (0, import_core53.useAudience)();
|
|
4427
|
+
const { data: topics } = (0, import_core54.useTopic)();
|
|
4428
|
+
const { data: types } = (0, import_core55.useResourceType)();
|
|
4429
|
+
const { data: languages } = (0, import_core56.useLanguages)();
|
|
4516
4430
|
const currentAudiences = audiences?.filter(
|
|
4517
4431
|
(audience) => resource.audience?.includes(audience.key)
|
|
4518
4432
|
) || [];
|
|
@@ -4523,8 +4437,8 @@ function ResourceView({
|
|
|
4523
4437
|
const currentTypes = types?.find((type) => type.key === resource.resourceType)?.value || resource.resourceType;
|
|
4524
4438
|
const link = resource.link || "";
|
|
4525
4439
|
const linkText = link.length > 70 ? `${link.slice(0, 70)}...` : link;
|
|
4526
|
-
return /* @__PURE__ */ (0,
|
|
4527
|
-
/* @__PURE__ */ (0,
|
|
4440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react27.Transition.Root, { show: open, as: import_react26.Fragment, "data-component": "ResourceView", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react27.Dialog, { as: "div", className: "relative z-10", onClose: setOpen, children: [
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4528
4442
|
import_react27.Transition.Child,
|
|
4529
4443
|
{
|
|
4530
4444
|
as: import_react26.Fragment,
|
|
@@ -4534,10 +4448,10 @@ function ResourceView({
|
|
|
4534
4448
|
leave: "ease-in duration-200",
|
|
4535
4449
|
leaveFrom: "opacity-100",
|
|
4536
4450
|
leaveTo: "opacity-0",
|
|
4537
|
-
children: /* @__PURE__ */ (0,
|
|
4451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" })
|
|
4538
4452
|
}
|
|
4539
4453
|
),
|
|
4540
|
-
/* @__PURE__ */ (0,
|
|
4454
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "fixed z-10 inset-0 overflow-y-auto text-black", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4541
4455
|
import_react27.Transition.Child,
|
|
4542
4456
|
{
|
|
4543
4457
|
as: import_react26.Fragment,
|
|
@@ -4547,16 +4461,16 @@ function ResourceView({
|
|
|
4547
4461
|
leave: "ease-in duration-200",
|
|
4548
4462
|
leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
|
|
4549
4463
|
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
4550
|
-
children: /* @__PURE__ */ (0,
|
|
4551
|
-
/* @__PURE__ */ (0,
|
|
4464
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react27.Dialog.Panel, { className: "relative bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl sm:w-full sm:p-10", children: [
|
|
4465
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "absolute top-0 right-0 pt-10 pr-10", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4552
4466
|
"button",
|
|
4553
4467
|
{
|
|
4554
4468
|
type: "button",
|
|
4555
4469
|
className: " rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 ",
|
|
4556
4470
|
onClick: () => setOpen(false),
|
|
4557
4471
|
children: [
|
|
4558
|
-
/* @__PURE__ */ (0,
|
|
4559
|
-
/* @__PURE__ */ (0,
|
|
4472
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "sr-only", children: "Close" }),
|
|
4473
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4560
4474
|
import_outline7.XMarkIcon,
|
|
4561
4475
|
{
|
|
4562
4476
|
className: "h-4 w-4 lg:h-6 lg:w-6",
|
|
@@ -4566,15 +4480,15 @@ function ResourceView({
|
|
|
4566
4480
|
]
|
|
4567
4481
|
}
|
|
4568
4482
|
) }),
|
|
4569
|
-
/* @__PURE__ */ (0,
|
|
4570
|
-
/* @__PURE__ */ (0,
|
|
4571
|
-
/* @__PURE__ */ (0,
|
|
4572
|
-
/* @__PURE__ */ (0,
|
|
4573
|
-
/* @__PURE__ */ (0,
|
|
4483
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "p-5 lg:px-6 lg:py-2", children: [
|
|
4484
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
4485
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex space-x-2 lg:block lg:space-x-0", children: [
|
|
4486
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ResourceIcon, { type: resource.resourceType }),
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.Body16sb, { className: "self-start mt-[10px] text-primary lg:mt-4", children: currentTypes })
|
|
4574
4488
|
] }),
|
|
4575
|
-
/* @__PURE__ */ (0,
|
|
4576
|
-
/* @__PURE__ */ (0,
|
|
4577
|
-
/* @__PURE__ */ (0,
|
|
4489
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.H3Design, { className: "mt-6", children: resource.title }),
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.Body16, { className: "mt-6", children: resource.description }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: " mt-6 whitespace-nowrap lg:mt-8", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core57.Link, { href: link, target: "_blank", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4578
4492
|
import_ui45.DesignButton,
|
|
4579
4493
|
{
|
|
4580
4494
|
variant: "externalLink",
|
|
@@ -4582,15 +4496,15 @@ function ResourceView({
|
|
|
4582
4496
|
children: linkText
|
|
4583
4497
|
}
|
|
4584
4498
|
) }) }),
|
|
4585
|
-
/* @__PURE__ */ (0,
|
|
4586
|
-
currentTypes && /* @__PURE__ */ (0,
|
|
4499
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "my-6 lg:my-10", children: [
|
|
4500
|
+
currentTypes && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4587
4501
|
DetailRow,
|
|
4588
4502
|
{
|
|
4589
4503
|
label: "Resource type:",
|
|
4590
4504
|
value: currentTypes
|
|
4591
4505
|
}
|
|
4592
4506
|
),
|
|
4593
|
-
resource.publisher && /* @__PURE__ */ (0,
|
|
4507
|
+
resource.publisher && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4594
4508
|
DetailRow,
|
|
4595
4509
|
{
|
|
4596
4510
|
label: "Publisher",
|
|
@@ -4598,7 +4512,7 @@ function ResourceView({
|
|
|
4598
4512
|
}
|
|
4599
4513
|
)
|
|
4600
4514
|
] }),
|
|
4601
|
-
currentTopics?.length > 0 && /* @__PURE__ */ (0,
|
|
4515
|
+
currentTopics?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4602
4516
|
KeyValues,
|
|
4603
4517
|
{
|
|
4604
4518
|
name: "Topic",
|
|
@@ -4609,7 +4523,7 @@ function ResourceView({
|
|
|
4609
4523
|
kind: "topic"
|
|
4610
4524
|
}
|
|
4611
4525
|
),
|
|
4612
|
-
currentAudiences?.length > 0 && /* @__PURE__ */ (0,
|
|
4526
|
+
currentAudiences?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4613
4527
|
KeyValues,
|
|
4614
4528
|
{
|
|
4615
4529
|
name: "Audience",
|
|
@@ -4620,10 +4534,10 @@ function ResourceView({
|
|
|
4620
4534
|
kind: "audience"
|
|
4621
4535
|
}
|
|
4622
4536
|
),
|
|
4623
|
-
resource?.keywords && resource?.keywords?.length > 0 && /* @__PURE__ */ (0,
|
|
4624
|
-
/* @__PURE__ */ (0,
|
|
4625
|
-
/* @__PURE__ */ (0,
|
|
4626
|
-
ResourceTag,
|
|
4537
|
+
resource?.keywords && resource?.keywords?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
4538
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.Caption, { className: "self-start lg:mt-10 tracking-wider text-grey", children: "Keywords" }),
|
|
4539
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center flex-wrap mt-2 mb-6 lg:mt-4 lg:mb-10", children: resource.keywords?.map((keyword, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4540
|
+
import_ui44.ResourceTag,
|
|
4627
4541
|
{
|
|
4628
4542
|
tag: keyword,
|
|
4629
4543
|
type: "keyword"
|
|
@@ -4631,7 +4545,7 @@ function ResourceView({
|
|
|
4631
4545
|
index
|
|
4632
4546
|
)) })
|
|
4633
4547
|
] }),
|
|
4634
|
-
currentLanguages?.length > 0 && /* @__PURE__ */ (0,
|
|
4548
|
+
currentLanguages?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4635
4549
|
KeyValues,
|
|
4636
4550
|
{
|
|
4637
4551
|
name: "Language",
|
|
@@ -4643,11 +4557,11 @@ function ResourceView({
|
|
|
4643
4557
|
}
|
|
4644
4558
|
)
|
|
4645
4559
|
] }),
|
|
4646
|
-
showResourcesButton && /* @__PURE__ */ (0,
|
|
4647
|
-
|
|
4560
|
+
showResourcesButton && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4561
|
+
import_core57.Link,
|
|
4648
4562
|
{
|
|
4649
4563
|
href: `/resources/resource-finder?topic=${selectedTopic}&audience=${selectedAudience}`,
|
|
4650
|
-
children: /* @__PURE__ */ (0,
|
|
4564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui45.DesignButton, { children: "View all Resources" })
|
|
4651
4565
|
}
|
|
4652
4566
|
) })
|
|
4653
4567
|
] })
|
|
@@ -4660,16 +4574,16 @@ var ResourceView_default = ResourceView;
|
|
|
4660
4574
|
|
|
4661
4575
|
// src/components/Resource/ResourceLink.tsx
|
|
4662
4576
|
var import_ui46 = require("@geowiki/ui");
|
|
4663
|
-
var
|
|
4577
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4664
4578
|
var ResourceLink = ({
|
|
4665
4579
|
resource,
|
|
4666
4580
|
selectedAudience,
|
|
4667
4581
|
selectedTopic
|
|
4668
4582
|
}) => {
|
|
4669
4583
|
const [open, setOpen] = (0, import_react28.useState)(false);
|
|
4670
|
-
return /* @__PURE__ */ (0,
|
|
4671
|
-
/* @__PURE__ */ (0,
|
|
4672
|
-
/* @__PURE__ */ (0,
|
|
4584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { onClick: () => setOpen(true), className: "cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_ui46.Body16, { className: "underline text-left", children: resource.title }) }),
|
|
4586
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4673
4587
|
ResourceView_default,
|
|
4674
4588
|
{
|
|
4675
4589
|
resource,
|
|
@@ -4685,8 +4599,8 @@ var ResourceLink = ({
|
|
|
4685
4599
|
|
|
4686
4600
|
// src/components/FarmerCluster/ResourcesQuickFind.tsx
|
|
4687
4601
|
var import_ui48 = require("@geowiki/ui");
|
|
4688
|
-
var
|
|
4689
|
-
var
|
|
4602
|
+
var import_core59 = require("@geowiki/core");
|
|
4603
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4690
4604
|
var ResourcesQuickFind = ({}) => {
|
|
4691
4605
|
const pageSize = 2;
|
|
4692
4606
|
const [selectedAudience, setSelectedAudience] = (0, import_react29.useState)();
|
|
@@ -4695,9 +4609,9 @@ var ResourcesQuickFind = ({}) => {
|
|
|
4695
4609
|
currentPage: 1,
|
|
4696
4610
|
pageSize
|
|
4697
4611
|
});
|
|
4698
|
-
const { data: audiences, isLoading: isAudienceLoading } = (0,
|
|
4699
|
-
const { data: topics, isLoading: isTopicsLoading } = (0,
|
|
4700
|
-
const { data, isLoading } = (0,
|
|
4612
|
+
const { data: audiences, isLoading: isAudienceLoading } = (0, import_core58.useAudience)();
|
|
4613
|
+
const { data: topics, isLoading: isTopicsLoading } = (0, import_core58.useTopic)();
|
|
4614
|
+
const { data, isLoading } = (0, import_core58.useResourceFilter)(filter);
|
|
4701
4615
|
const handleAudienceChange = (selectedValue) => {
|
|
4702
4616
|
setSelectedAudience(selectedValue);
|
|
4703
4617
|
setFilter({
|
|
@@ -4721,9 +4635,9 @@ var ResourcesQuickFind = ({}) => {
|
|
|
4721
4635
|
});
|
|
4722
4636
|
return updatedArray;
|
|
4723
4637
|
};
|
|
4724
|
-
return /* @__PURE__ */ (0,
|
|
4725
|
-
/* @__PURE__ */ (0,
|
|
4726
|
-
/* @__PURE__ */ (0,
|
|
4638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("section", { className: "flex justify-center items-center mt-6 p-5 bg-accent-light-purple rounded-xl lg:mt-12 lg:px-16 lg:py-20", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "lg:container mx-auto w-full max-w-[1116px] ", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "lg:flex lg:gap-5 ", children: [
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col lg:w-[57%] ", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col text-gray-900 space-y-4 lg:space-y-6 lg:mt-2.5", children: [
|
|
4640
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4727
4641
|
import_ui47.HtmlView,
|
|
4728
4642
|
{
|
|
4729
4643
|
cssClass: "m-0 pt-2 lg:pt-0",
|
|
@@ -4733,14 +4647,14 @@ var ResourcesQuickFind = ({}) => {
|
|
|
4733
4647
|
)
|
|
4734
4648
|
}
|
|
4735
4649
|
),
|
|
4736
|
-
/* @__PURE__ */ (0,
|
|
4737
|
-
/* @__PURE__ */ (0,
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.Body18, { className: "lg:w-[65%]", children: "Tell us about what your looking for and we will recommend some resources to help you get started." }),
|
|
4651
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4738
4652
|
import_ui47.DesignButton,
|
|
4739
4653
|
{
|
|
4740
4654
|
className: "h-auto p-0 lg:p-0 self-start",
|
|
4741
4655
|
variant: "internalLink",
|
|
4742
|
-
children: /* @__PURE__ */ (0,
|
|
4743
|
-
|
|
4656
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4657
|
+
import_core59.Link,
|
|
4744
4658
|
{
|
|
4745
4659
|
href: "/resources/resource-finder",
|
|
4746
4660
|
target: "_self",
|
|
@@ -4751,17 +4665,17 @@ var ResourcesQuickFind = ({}) => {
|
|
|
4751
4665
|
}
|
|
4752
4666
|
)
|
|
4753
4667
|
] }) }),
|
|
4754
|
-
/* @__PURE__ */ (0,
|
|
4755
|
-
/* @__PURE__ */ (0,
|
|
4756
|
-
/* @__PURE__ */ (0,
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pt-6 flex flex-col w-full lg:ml-5 lg:w-[43%] lg:pt-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("form", { className: "flex flex-col grow w-full lg:w-full text-base font-medium leading-5 text-gray-900 rounded-xl bg-white bg-opacity-40 lg:min-w-[24rem] ", children: !isAudienceLoading && !isTopicsLoading && audiences && topics && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-full flex-col flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: " w-full lg:w-[20rem] p-8 bg-opacity-40 rounded-xl", children: [
|
|
4669
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.Body16m, { className: "pb-1", children: "I am a" }),
|
|
4670
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4757
4671
|
import_ui47.DesignSelect,
|
|
4758
4672
|
{
|
|
4759
4673
|
onValueChange: (v) => {
|
|
4760
4674
|
handleAudienceChange(v);
|
|
4761
4675
|
},
|
|
4762
4676
|
children: [
|
|
4763
|
-
/* @__PURE__ */ (0,
|
|
4764
|
-
/* @__PURE__ */ (0,
|
|
4677
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectTrigger, { className: "w-full lg:w-80 bg-white", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectValue, { placeholder: "Select one" }) }),
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectGroup, { children: audiences.map((audience) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4765
4679
|
import_ui47.DesignSelectItem,
|
|
4766
4680
|
{
|
|
4767
4681
|
value: audience.key,
|
|
@@ -4772,16 +4686,16 @@ var ResourcesQuickFind = ({}) => {
|
|
|
4772
4686
|
]
|
|
4773
4687
|
}
|
|
4774
4688
|
),
|
|
4775
|
-
/* @__PURE__ */ (0,
|
|
4776
|
-
/* @__PURE__ */ (0,
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.Body16m, { className: "pb-1 pt-8", children: "I'd like to learn more about" }),
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4777
4691
|
import_ui47.DesignSelect,
|
|
4778
4692
|
{
|
|
4779
4693
|
onValueChange: (v) => {
|
|
4780
4694
|
handleTopicChange(v);
|
|
4781
4695
|
},
|
|
4782
4696
|
children: [
|
|
4783
|
-
/* @__PURE__ */ (0,
|
|
4784
|
-
/* @__PURE__ */ (0,
|
|
4697
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectTrigger, { className: "w-full lg:w-80 bg-white", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectValue, { placeholder: "Select one" }) }),
|
|
4698
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.DesignSelectGroup, { children: updateTopics().map((topic) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4785
4699
|
import_ui47.DesignSelectItem,
|
|
4786
4700
|
{
|
|
4787
4701
|
value: topic.key,
|
|
@@ -4792,9 +4706,9 @@ var ResourcesQuickFind = ({}) => {
|
|
|
4792
4706
|
]
|
|
4793
4707
|
}
|
|
4794
4708
|
),
|
|
4795
|
-
selectedAudience && selectedTopic && !isLoading && /* @__PURE__ */ (0,
|
|
4796
|
-
/* @__PURE__ */ (0,
|
|
4797
|
-
data?.items.map((item) => /* @__PURE__ */ (0,
|
|
4709
|
+
selectedAudience && selectedTopic && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: data?.items?.length && data?.items?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-2 pt-4", children: [
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.Body16m, { children: "Have a look at:" }),
|
|
4711
|
+
data?.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4798
4712
|
ResourceLink,
|
|
4799
4713
|
{
|
|
4800
4714
|
resource: item,
|
|
@@ -4803,23 +4717,23 @@ var ResourcesQuickFind = ({}) => {
|
|
|
4803
4717
|
},
|
|
4804
4718
|
item.id
|
|
4805
4719
|
))
|
|
4806
|
-
] }) : /* @__PURE__ */ (0,
|
|
4720
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui47.Body16, { className: "pt-4", children: "No results available, please try a different search" }) })
|
|
4807
4721
|
] }) }) }) })
|
|
4808
4722
|
] }) }) });
|
|
4809
4723
|
};
|
|
4810
4724
|
|
|
4811
4725
|
// src/components/FarmerCluster/FarmerClusterLinkPartner.tsx
|
|
4812
4726
|
var import_ui49 = require("@geowiki/ui");
|
|
4813
|
-
var
|
|
4727
|
+
var import_core60 = require("@geowiki/core");
|
|
4814
4728
|
var import_react30 = require("react");
|
|
4815
4729
|
var import_react_hook_form8 = require("react-hook-form");
|
|
4816
4730
|
var import_zod5 = require("zod");
|
|
4817
4731
|
var import_zod6 = require("@hookform/resolvers/zod");
|
|
4818
4732
|
var import_api_proxy13 = require("@geowiki/api-proxy");
|
|
4819
4733
|
var import_sweetalert26 = __toESM(require("sweetalert2"));
|
|
4820
|
-
var
|
|
4734
|
+
var import_core61 = require("@geowiki/core");
|
|
4821
4735
|
var import_react_query7 = require("@tanstack/react-query");
|
|
4822
|
-
var
|
|
4736
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4823
4737
|
var LinkRow = ({ linkName, url, index }) => {
|
|
4824
4738
|
const methods = (0, import_react_hook_form8.useFormContext)();
|
|
4825
4739
|
const {
|
|
@@ -4829,10 +4743,10 @@ var LinkRow = ({ linkName, url, index }) => {
|
|
|
4829
4743
|
const [name, setName] = (0, import_react30.useState)(linkName);
|
|
4830
4744
|
const [urlItem, setUrlItem] = (0, import_react30.useState)(url);
|
|
4831
4745
|
const linkErrors = errors?.links;
|
|
4832
|
-
return /* @__PURE__ */ (0,
|
|
4833
|
-
/* @__PURE__ */ (0,
|
|
4834
|
-
/* @__PURE__ */ (0,
|
|
4835
|
-
/* @__PURE__ */ (0,
|
|
4746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
4747
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col min-w-96", children: [
|
|
4748
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs text-zinc-500 max-md:max-w-full", children: "Link name" }),
|
|
4749
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4836
4750
|
import_ui49.DesignInput,
|
|
4837
4751
|
{
|
|
4838
4752
|
...register(`links.${index}.name`),
|
|
@@ -4843,7 +4757,7 @@ var LinkRow = ({ linkName, url, index }) => {
|
|
|
4843
4757
|
}
|
|
4844
4758
|
}
|
|
4845
4759
|
),
|
|
4846
|
-
/* @__PURE__ */ (0,
|
|
4760
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4847
4761
|
"input",
|
|
4848
4762
|
{
|
|
4849
4763
|
type: "hidden",
|
|
@@ -4851,11 +4765,11 @@ var LinkRow = ({ linkName, url, index }) => {
|
|
|
4851
4765
|
value: index
|
|
4852
4766
|
}
|
|
4853
4767
|
),
|
|
4854
|
-
linkErrors?.[index]?.name && /* @__PURE__ */ (0,
|
|
4768
|
+
linkErrors?.[index]?.name && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-red-500", children: linkErrors?.[index]?.name?.message })
|
|
4855
4769
|
] }),
|
|
4856
|
-
/* @__PURE__ */ (0,
|
|
4857
|
-
/* @__PURE__ */ (0,
|
|
4858
|
-
/* @__PURE__ */ (0,
|
|
4770
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col min-w-96", children: [
|
|
4771
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs text-zinc-500 max-md:max-w-full", children: "URL" }),
|
|
4772
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4859
4773
|
import_ui49.DesignInput,
|
|
4860
4774
|
{
|
|
4861
4775
|
...register(`links.${index}.link`),
|
|
@@ -4867,7 +4781,7 @@ var LinkRow = ({ linkName, url, index }) => {
|
|
|
4867
4781
|
}
|
|
4868
4782
|
}
|
|
4869
4783
|
),
|
|
4870
|
-
linkErrors?.[index]?.link && /* @__PURE__ */ (0,
|
|
4784
|
+
linkErrors?.[index]?.link && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-red-500", children: linkErrors?.[index]?.link?.message })
|
|
4871
4785
|
] })
|
|
4872
4786
|
] });
|
|
4873
4787
|
};
|
|
@@ -4880,10 +4794,10 @@ var PartnerRow = ({ partnerName, url, index }) => {
|
|
|
4880
4794
|
const [urlItem, setUrlItem] = (0, import_react30.useState)(url);
|
|
4881
4795
|
const [partnerNameItem, setPartnerNameItem] = (0, import_react30.useState)(partnerName);
|
|
4882
4796
|
const partnerErrors = errors?.partners;
|
|
4883
|
-
return /* @__PURE__ */ (0,
|
|
4884
|
-
/* @__PURE__ */ (0,
|
|
4885
|
-
/* @__PURE__ */ (0,
|
|
4886
|
-
/* @__PURE__ */ (0,
|
|
4797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col min-w-96", children: [
|
|
4799
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs text-zinc-500 max-md:max-w-full", children: "Partner name" }),
|
|
4800
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4887
4801
|
import_ui49.DesignInput,
|
|
4888
4802
|
{
|
|
4889
4803
|
...register(`partners.${index}.name`),
|
|
@@ -4894,7 +4808,7 @@ var PartnerRow = ({ partnerName, url, index }) => {
|
|
|
4894
4808
|
}
|
|
4895
4809
|
}
|
|
4896
4810
|
),
|
|
4897
|
-
/* @__PURE__ */ (0,
|
|
4811
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4898
4812
|
"input",
|
|
4899
4813
|
{
|
|
4900
4814
|
type: "hidden",
|
|
@@ -4902,11 +4816,11 @@ var PartnerRow = ({ partnerName, url, index }) => {
|
|
|
4902
4816
|
value: index
|
|
4903
4817
|
}
|
|
4904
4818
|
),
|
|
4905
|
-
partnerErrors?.[index]?.name && /* @__PURE__ */ (0,
|
|
4819
|
+
partnerErrors?.[index]?.name && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-red-500", children: partnerErrors?.[index]?.name?.message })
|
|
4906
4820
|
] }),
|
|
4907
|
-
/* @__PURE__ */ (0,
|
|
4908
|
-
/* @__PURE__ */ (0,
|
|
4909
|
-
/* @__PURE__ */ (0,
|
|
4821
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col min-w-96", children: [
|
|
4822
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs text-zinc-500 max-md:max-w-full", children: "URL" }),
|
|
4823
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4910
4824
|
import_ui49.DesignInput,
|
|
4911
4825
|
{
|
|
4912
4826
|
...register(`partners.${index}.link`),
|
|
@@ -4918,7 +4832,7 @@ var PartnerRow = ({ partnerName, url, index }) => {
|
|
|
4918
4832
|
}
|
|
4919
4833
|
}
|
|
4920
4834
|
),
|
|
4921
|
-
partnerErrors?.[index]?.link && /* @__PURE__ */ (0,
|
|
4835
|
+
partnerErrors?.[index]?.link && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-red-500", children: partnerErrors?.[index]?.link?.message })
|
|
4922
4836
|
] })
|
|
4923
4837
|
] });
|
|
4924
4838
|
};
|
|
@@ -4951,12 +4865,12 @@ var LinkPartnerSchema = import_zod5.z.object({
|
|
|
4951
4865
|
).optional()
|
|
4952
4866
|
});
|
|
4953
4867
|
var FarmerClusterLinkPartner = () => {
|
|
4954
|
-
const router = (0,
|
|
4868
|
+
const router = (0, import_core60.useRouter)();
|
|
4955
4869
|
const clusterId = router.query.id;
|
|
4956
4870
|
const queryClient = (0, import_react_query7.useQueryClient)();
|
|
4957
4871
|
const [isSavedPopupOpen, setSavedPopupOpen] = (0, import_react30.useState)(false);
|
|
4958
4872
|
const [isCancelPopupOpen, setCancelPopupOpen] = (0, import_react30.useState)(false);
|
|
4959
|
-
const { data: clusterLinksAndPartners, isLoading } = (0,
|
|
4873
|
+
const { data: clusterLinksAndPartners, isLoading } = (0, import_core61.useClusterLinks)(clusterId);
|
|
4960
4874
|
const links = clusterLinksAndPartners?.socialLinks?.filter((x) => x.type === "Social")?.sort((a, b) => a.order - b.order).map((link) => ({
|
|
4961
4875
|
name: link.name,
|
|
4962
4876
|
link: link.link,
|
|
@@ -5023,7 +4937,7 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5023
4937
|
await import_api_proxy13.ClusterService.clusterUpdateLinksAndPartner(partnerAndLinkDto);
|
|
5024
4938
|
setSavedPopupOpen(true);
|
|
5025
4939
|
queryClient.invalidateQueries({
|
|
5026
|
-
queryKey: [
|
|
4940
|
+
queryKey: [import_core61.QueryNames.GetSocialLinks, clusterId]
|
|
5027
4941
|
});
|
|
5028
4942
|
} catch (error) {
|
|
5029
4943
|
import_sweetalert26.default.fire({
|
|
@@ -5040,17 +4954,17 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5040
4954
|
});
|
|
5041
4955
|
}, [isLoading]);
|
|
5042
4956
|
if (isLoading) {
|
|
5043
|
-
return /* @__PURE__ */ (0,
|
|
4957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: "Loading..." });
|
|
5044
4958
|
}
|
|
5045
|
-
return /* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
4959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_hook_form8.FormProvider, { ...methods, children: [
|
|
4960
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5047
4961
|
"form",
|
|
5048
4962
|
{
|
|
5049
4963
|
className: "relative bg-white rounded-xl p-4",
|
|
5050
4964
|
onSubmit: methods.handleSubmit(onSubmit),
|
|
5051
4965
|
children: [
|
|
5052
|
-
/* @__PURE__ */ (0,
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
4966
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "right-6 top-6 flex gap-2 absolute", children: [
|
|
4967
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5054
4968
|
import_ui49.DesignButton,
|
|
5055
4969
|
{
|
|
5056
4970
|
type: "button",
|
|
@@ -5060,10 +4974,10 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5060
4974
|
children: "Cancel"
|
|
5061
4975
|
}
|
|
5062
4976
|
),
|
|
5063
|
-
/* @__PURE__ */ (0,
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui49.DesignButton, { type: "submit", size: "sm", children: "Save" })
|
|
5064
4978
|
] }),
|
|
5065
|
-
/* @__PURE__ */ (0,
|
|
5066
|
-
/* @__PURE__ */ (0,
|
|
4979
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col p-6 bg-white rounded-xl max-w-[936px] max-md:px-5", children: [
|
|
4980
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5067
4981
|
SectionHeader,
|
|
5068
4982
|
{
|
|
5069
4983
|
title: "Links",
|
|
@@ -5071,9 +4985,9 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5071
4985
|
info: "Do you run your own Farmer Cluster website or social media channels? You can add them individually here and they will show up as external links in your Farmer Cluster Profile, guiding visitors to your website and socials."
|
|
5072
4986
|
}
|
|
5073
4987
|
),
|
|
5074
|
-
/* @__PURE__ */ (0,
|
|
5075
|
-
/* @__PURE__ */ (0,
|
|
5076
|
-
/* @__PURE__ */ (0,
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("main", { children: [
|
|
4989
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "space-y-4", children: linkFields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { className: "space-y-4", children: [
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5077
4991
|
LinkRow,
|
|
5078
4992
|
{
|
|
5079
4993
|
linkName: field.name,
|
|
@@ -5081,7 +4995,7 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5081
4995
|
index
|
|
5082
4996
|
}
|
|
5083
4997
|
),
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
4998
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5085
4999
|
import_ui49.DesignButton,
|
|
5086
5000
|
{
|
|
5087
5001
|
variant: "outlineGrey",
|
|
@@ -5094,7 +5008,7 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5094
5008
|
}
|
|
5095
5009
|
)
|
|
5096
5010
|
] }) }, index)) }),
|
|
5097
|
-
/* @__PURE__ */ (0,
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5098
5012
|
import_ui49.DesignButton,
|
|
5099
5013
|
{
|
|
5100
5014
|
size: "sm",
|
|
@@ -5105,8 +5019,8 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5105
5019
|
children: "Add another link"
|
|
5106
5020
|
}
|
|
5107
5021
|
),
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
5109
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { className: "mt-10", children: [
|
|
5023
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5110
5024
|
SectionHeader,
|
|
5111
5025
|
{
|
|
5112
5026
|
title: "Partners",
|
|
@@ -5114,8 +5028,8 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5114
5028
|
info: "Does your Farmer Cluster work and collaborate with local or national partners? You can list and add links to your collaborators, friends and partner organisations on your Farmer Cluster profile."
|
|
5115
5029
|
}
|
|
5116
5030
|
),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5118
|
-
/* @__PURE__ */ (0,
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "space-y-4", children: partnerFields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { className: "space-y-4", children: [
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5119
5033
|
PartnerRow,
|
|
5120
5034
|
{
|
|
5121
5035
|
partnerName: field.name,
|
|
@@ -5123,7 +5037,7 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5123
5037
|
index
|
|
5124
5038
|
}
|
|
5125
5039
|
),
|
|
5126
|
-
/* @__PURE__ */ (0,
|
|
5040
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5127
5041
|
import_ui49.DesignButton,
|
|
5128
5042
|
{
|
|
5129
5043
|
variant: "outlineGrey",
|
|
@@ -5136,7 +5050,7 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5136
5050
|
}
|
|
5137
5051
|
)
|
|
5138
5052
|
] }) }, index)) }),
|
|
5139
|
-
/* @__PURE__ */ (0,
|
|
5053
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5140
5054
|
import_ui49.DesignButton,
|
|
5141
5055
|
{
|
|
5142
5056
|
size: "sm",
|
|
@@ -5153,7 +5067,7 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5153
5067
|
]
|
|
5154
5068
|
}
|
|
5155
5069
|
),
|
|
5156
|
-
/* @__PURE__ */ (0,
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5157
5071
|
FarmerClusterPopup,
|
|
5158
5072
|
{
|
|
5159
5073
|
title: "Your changes have been saved",
|
|
@@ -5163,28 +5077,74 @@ var FarmerClusterLinkPartner = () => {
|
|
|
5163
5077
|
setOpen: setSavedPopupOpen
|
|
5164
5078
|
}
|
|
5165
5079
|
),
|
|
5166
|
-
/* @__PURE__ */ (0,
|
|
5080
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CancelPopup, { open: isCancelPopupOpen, setOpen: setCancelPopupOpen })
|
|
5167
5081
|
] });
|
|
5168
5082
|
};
|
|
5169
5083
|
|
|
5170
5084
|
// src/components/FarmerCluster/FarmerClusterCreate.tsx
|
|
5171
5085
|
var import_react31 = require("react");
|
|
5172
5086
|
var import_react_hook_form9 = require("react-hook-form");
|
|
5173
|
-
var
|
|
5087
|
+
var import_core62 = require("@geowiki/core");
|
|
5174
5088
|
var import_sweetalert27 = __toESM(require("sweetalert2"));
|
|
5175
5089
|
var import_ui50 = require("@geowiki/ui");
|
|
5176
|
-
var
|
|
5177
|
-
var
|
|
5090
|
+
var import_core63 = require("@geowiki/core");
|
|
5091
|
+
var import_core64 = require("@geowiki/core");
|
|
5178
5092
|
var import_api_proxy14 = require("@geowiki/api-proxy");
|
|
5179
5093
|
var import_ui51 = require("@geowiki/ui");
|
|
5180
|
-
var
|
|
5094
|
+
var import_core65 = require("@geowiki/core");
|
|
5181
5095
|
var import_zod7 = require("@hookform/resolvers/zod");
|
|
5182
5096
|
var import_date_fns2 = require("date-fns");
|
|
5183
5097
|
var import_react_dropzone5 = require("react-dropzone");
|
|
5184
|
-
var
|
|
5185
|
-
var MapWithNoSSR2 = (0,
|
|
5098
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5099
|
+
var MapWithNoSSR2 = (0, import_core62.dynamic)(() => Promise.resolve().then(() => (init_cluster_map(), cluster_map_exports)), {
|
|
5186
5100
|
ssr: false
|
|
5187
5101
|
});
|
|
5102
|
+
var CoverImageDropzone = ({ field, onFileSelected }) => {
|
|
5103
|
+
const coverImageDropzone = (0, import_react_dropzone5.useDropzone)({
|
|
5104
|
+
accept: {
|
|
5105
|
+
"image/jpeg": [".jpeg", ".png"]
|
|
5106
|
+
},
|
|
5107
|
+
maxFiles: 1,
|
|
5108
|
+
multiple: false,
|
|
5109
|
+
onDrop: (acceptedFiles) => {
|
|
5110
|
+
const selectedFile = acceptedFiles[0];
|
|
5111
|
+
onFileSelected(selectedFile);
|
|
5112
|
+
field.onChange(selectedFile);
|
|
5113
|
+
}
|
|
5114
|
+
});
|
|
5115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-1 sm:mt-0 sm:col-span-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[70%] py-12 pb-14 flex justify-center px-6 border-2 border-grey-light border-dashed rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ...coverImageDropzone.getRootProps(), children: [
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { ...coverImageDropzone.getInputProps({}) }),
|
|
5117
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "w-full text-center flex-col flex items-center", children: [
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-16 h-16 bg-accent-primary flex items-center justify-center rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5119
|
+
"svg",
|
|
5120
|
+
{
|
|
5121
|
+
width: "32",
|
|
5122
|
+
height: "32",
|
|
5123
|
+
viewBox: "0 0 32 32",
|
|
5124
|
+
fill: "none",
|
|
5125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5126
|
+
className: " fill-primary",
|
|
5127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M19.667 8V5L25.667 11H22.667C20.5603 11 19.667 10.1067 19.667 8ZM22.667 13C19.4403 13 17.667 11.2267 17.667 8V4H10.667C8.00033 4 6.66699 5.33333 6.66699 8V24C6.66699 26.6667 8.00033 28 10.667 28H22.667C25.3337 28 26.667 26.6667 26.667 24V13H22.667Z" })
|
|
5128
|
+
}
|
|
5129
|
+
) }),
|
|
5130
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-6 flex justify-center", children: [
|
|
5131
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "pr-1 text-lg font-normal", children: "Drop your files here or" }),
|
|
5132
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5133
|
+
"label",
|
|
5134
|
+
{
|
|
5135
|
+
htmlFor: "file-upload",
|
|
5136
|
+
className: "relative cursor-pointer rounded-md font-medium text-primary hover:text-primary-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500",
|
|
5137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-lg font-semibold", children: [
|
|
5138
|
+
" ",
|
|
5139
|
+
"browse"
|
|
5140
|
+
] })
|
|
5141
|
+
}
|
|
5142
|
+
)
|
|
5143
|
+
] }),
|
|
5144
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-normal text-grey pt-2", children: "PNG, JPG, GIF up to 10MB. Landscape mode, recommended size 1920x1080px." })
|
|
5145
|
+
] })
|
|
5146
|
+
] }) }) });
|
|
5147
|
+
};
|
|
5188
5148
|
var FarmerClusterCreate = () => {
|
|
5189
5149
|
const [openSevedPopup, setOpenSevedPopup] = (0, import_react31.useState)(false);
|
|
5190
5150
|
const [selectedFileUrl, setSelectedFileUrl] = (0, import_react31.useState)(null);
|
|
@@ -5200,8 +5160,8 @@ var FarmerClusterCreate = () => {
|
|
|
5200
5160
|
watch
|
|
5201
5161
|
} = methods;
|
|
5202
5162
|
const mapRef = (0, import_react31.useRef)(null);
|
|
5203
|
-
const { data: countries, isLoading: isCountryLoading } = (0,
|
|
5204
|
-
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0,
|
|
5163
|
+
const { data: countries, isLoading: isCountryLoading } = (0, import_core63.useCountries)(true);
|
|
5164
|
+
var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = (0, import_core64.useConfigSettings)();
|
|
5205
5165
|
const setClusterImage = async (file, clusterId) => {
|
|
5206
5166
|
return await import_api_proxy14.ClusterService.clusterSetCoverImage({
|
|
5207
5167
|
File: file,
|
|
@@ -5228,7 +5188,7 @@ var FarmerClusterCreate = () => {
|
|
|
5228
5188
|
}
|
|
5229
5189
|
}, [errors]);
|
|
5230
5190
|
const [position, setPosition] = (0, import_react31.useState)(null);
|
|
5231
|
-
const router = (0,
|
|
5191
|
+
const router = (0, import_core65.useRouter)();
|
|
5232
5192
|
const onSubmit = async (data) => {
|
|
5233
5193
|
if (position == null && mapRef.current !== null && mapRef.current !== void 0) {
|
|
5234
5194
|
mapRef.current.style.color = "red";
|
|
@@ -5290,20 +5250,19 @@ var FarmerClusterCreate = () => {
|
|
|
5290
5250
|
import_sweetalert27.default.fire("Cluster creation failed", "error");
|
|
5291
5251
|
}
|
|
5292
5252
|
};
|
|
5293
|
-
if (IsConfigSettingsLoaded || isCountryLoading)
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5253
|
+
if (IsConfigSettingsLoaded || isCountryLoading) return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui51.LoaderFull, {});
|
|
5254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative bg-white rounded-xl", children: [
|
|
5255
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_hook_form9.FormProvider, { ...methods, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("form", { className: "space-y-8 py-8 px-6", onSubmit: handleSubmit(onSubmit), children: [
|
|
5256
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5257
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5299
5258
|
SectionHeader,
|
|
5300
5259
|
{
|
|
5301
5260
|
title: "Farmer Cluster details",
|
|
5302
5261
|
subTitle: "Add your Farmer Cluster details"
|
|
5303
5262
|
}
|
|
5304
5263
|
),
|
|
5305
|
-
/* @__PURE__ */ (0,
|
|
5306
|
-
/* @__PURE__ */ (0,
|
|
5264
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "right-6 top-6 flex gap-2 absolute", children: [
|
|
5265
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5307
5266
|
import_ui50.DesignButton,
|
|
5308
5267
|
{
|
|
5309
5268
|
type: "button",
|
|
@@ -5313,18 +5272,18 @@ var FarmerClusterCreate = () => {
|
|
|
5313
5272
|
children: "Cancel"
|
|
5314
5273
|
}
|
|
5315
5274
|
),
|
|
5316
|
-
/* @__PURE__ */ (0,
|
|
5275
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignButton, { type: "submit", size: "sm", children: "Save" })
|
|
5317
5276
|
] })
|
|
5318
5277
|
] }),
|
|
5319
|
-
/* @__PURE__ */ (0,
|
|
5320
|
-
/* @__PURE__ */ (0,
|
|
5321
|
-
/* @__PURE__ */ (0,
|
|
5322
|
-
/* @__PURE__ */ (0,
|
|
5278
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5279
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-x-4 gap-y-8", children: [
|
|
5280
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5281
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5323
5282
|
import_ui50.FormField,
|
|
5324
5283
|
{
|
|
5325
5284
|
control,
|
|
5326
5285
|
name: "name",
|
|
5327
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5286
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5328
5287
|
import_ui50.DesignInput,
|
|
5329
5288
|
{
|
|
5330
5289
|
...field,
|
|
@@ -5333,35 +5292,35 @@ var FarmerClusterCreate = () => {
|
|
|
5333
5292
|
)
|
|
5334
5293
|
}
|
|
5335
5294
|
),
|
|
5336
|
-
errors.name && /* @__PURE__ */ (0,
|
|
5295
|
+
errors.name && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.name.message })
|
|
5337
5296
|
] }),
|
|
5338
|
-
/* @__PURE__ */ (0,
|
|
5339
|
-
/* @__PURE__ */ (0,
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5298
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5340
5299
|
import_ui50.FormField,
|
|
5341
5300
|
{
|
|
5342
5301
|
control,
|
|
5343
5302
|
name: "email",
|
|
5344
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5303
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignInput, { ...field, placeholder: "Contact Email*" })
|
|
5345
5304
|
}
|
|
5346
5305
|
),
|
|
5347
|
-
errors.email && /* @__PURE__ */ (0,
|
|
5306
|
+
errors.email && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.email.message })
|
|
5348
5307
|
] }),
|
|
5349
|
-
/* @__PURE__ */ (0,
|
|
5350
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5351
5310
|
import_ui50.FormField,
|
|
5352
5311
|
{
|
|
5353
5312
|
control,
|
|
5354
5313
|
name: "countryId",
|
|
5355
5314
|
render: ({ field }) => {
|
|
5356
|
-
return /* @__PURE__ */ (0,
|
|
5315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
5357
5316
|
import_ui50.DesignSelect,
|
|
5358
5317
|
{
|
|
5359
5318
|
onValueChange: field.onChange,
|
|
5360
5319
|
defaultValue: field.value,
|
|
5361
5320
|
children: [
|
|
5362
|
-
/* @__PURE__ */ (0,
|
|
5363
|
-
/* @__PURE__ */ (0,
|
|
5364
|
-
return /* @__PURE__ */ (0,
|
|
5321
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectTrigger, { variant: "input", className: "pl-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectValue, { placeholder: "Country" }) }),
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectGroup, { children: countries?.map((country) => {
|
|
5323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5365
5324
|
import_ui50.DesignSelectItem,
|
|
5366
5325
|
{
|
|
5367
5326
|
value: country.id,
|
|
@@ -5376,24 +5335,24 @@ var FarmerClusterCreate = () => {
|
|
|
5376
5335
|
}
|
|
5377
5336
|
}
|
|
5378
5337
|
),
|
|
5379
|
-
errors.countryId && /* @__PURE__ */ (0,
|
|
5338
|
+
errors.countryId && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.countryId.message })
|
|
5380
5339
|
] }),
|
|
5381
|
-
/* @__PURE__ */ (0,
|
|
5382
|
-
/* @__PURE__ */ (0,
|
|
5340
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5341
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5383
5342
|
import_ui50.FormField,
|
|
5384
5343
|
{
|
|
5385
5344
|
control,
|
|
5386
5345
|
name: "activityStatus",
|
|
5387
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5346
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
5388
5347
|
import_ui50.DesignSelect,
|
|
5389
5348
|
{
|
|
5390
5349
|
onValueChange: field.onChange,
|
|
5391
5350
|
defaultValue: field.value,
|
|
5392
5351
|
children: [
|
|
5393
|
-
/* @__PURE__ */ (0,
|
|
5394
|
-
/* @__PURE__ */ (0,
|
|
5352
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectTrigger, { variant: "input", className: "pl-0", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectValue, { placeholder: "Activity Status" }) }),
|
|
5353
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.DesignSelectGroup, { children: ConfigSettings?.ActivityStatus?.ContentItems?.map(
|
|
5395
5354
|
(activity) => {
|
|
5396
|
-
return /* @__PURE__ */ (0,
|
|
5355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5397
5356
|
import_ui50.DesignSelectItem,
|
|
5398
5357
|
{
|
|
5399
5358
|
value: activity.KeyValueItem?.Key?.Text,
|
|
@@ -5408,28 +5367,28 @@ var FarmerClusterCreate = () => {
|
|
|
5408
5367
|
)
|
|
5409
5368
|
}
|
|
5410
5369
|
),
|
|
5411
|
-
errors.activityStatus && /* @__PURE__ */ (0,
|
|
5370
|
+
errors.activityStatus && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.activityStatus.message })
|
|
5412
5371
|
] }),
|
|
5413
|
-
/* @__PURE__ */ (0,
|
|
5414
|
-
/* @__PURE__ */ (0,
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5373
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5415
5374
|
import_ui50.FormField,
|
|
5416
5375
|
{
|
|
5417
5376
|
control,
|
|
5418
5377
|
name: "dateEstablished",
|
|
5419
5378
|
render: ({ field }) => {
|
|
5420
5379
|
var value = field.value && field.value.toString() !== "Invalid Date" ? new Date(field.value) : null;
|
|
5421
|
-
return /* @__PURE__ */ (0,
|
|
5422
|
-
/* @__PURE__ */ (0,
|
|
5380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_ui50.Popover, { children: [
|
|
5381
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5423
5382
|
"button",
|
|
5424
5383
|
{
|
|
5425
5384
|
className: (0, import_ui50.cn)(
|
|
5426
5385
|
"w-full pt-1.5 pb-[5px] text-start bordered-0 text-sm lg:text-base bg-transparent border-0 border-b border-zinc-300 focus-within:border-b-2 focus-within:pb-[4px] focus-within:border-primary focus:ring-0 focus:outline-none",
|
|
5427
5386
|
!value && "text-muted-foreground"
|
|
5428
5387
|
),
|
|
5429
|
-
children: value ? (0, import_date_fns2.format)(value, "PPP") : /* @__PURE__ */ (0,
|
|
5388
|
+
children: value ? (0, import_date_fns2.format)(value, "PPP") : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "Cluster creation date" })
|
|
5430
5389
|
}
|
|
5431
5390
|
) }) }),
|
|
5432
|
-
/* @__PURE__ */ (0,
|
|
5391
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5433
5392
|
import_ui50.Calendar,
|
|
5434
5393
|
{
|
|
5435
5394
|
mode: "single",
|
|
@@ -5443,15 +5402,15 @@ var FarmerClusterCreate = () => {
|
|
|
5443
5402
|
}
|
|
5444
5403
|
}
|
|
5445
5404
|
),
|
|
5446
|
-
errors.dateEstablished && /* @__PURE__ */ (0,
|
|
5405
|
+
errors.dateEstablished && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.dateEstablished.message })
|
|
5447
5406
|
] }),
|
|
5448
|
-
/* @__PURE__ */ (0,
|
|
5449
|
-
/* @__PURE__ */ (0,
|
|
5407
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5408
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5450
5409
|
import_ui50.FormField,
|
|
5451
5410
|
{
|
|
5452
5411
|
control,
|
|
5453
5412
|
name: "noOfFarms",
|
|
5454
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5413
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5455
5414
|
import_ui50.DesignInput,
|
|
5456
5415
|
{
|
|
5457
5416
|
...field,
|
|
@@ -5461,15 +5420,15 @@ var FarmerClusterCreate = () => {
|
|
|
5461
5420
|
)
|
|
5462
5421
|
}
|
|
5463
5422
|
),
|
|
5464
|
-
errors.noOfFarms && /* @__PURE__ */ (0,
|
|
5423
|
+
errors.noOfFarms && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.noOfFarms.message })
|
|
5465
5424
|
] }),
|
|
5466
|
-
/* @__PURE__ */ (0,
|
|
5467
|
-
/* @__PURE__ */ (0,
|
|
5425
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5426
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5468
5427
|
import_ui50.FormField,
|
|
5469
5428
|
{
|
|
5470
5429
|
control,
|
|
5471
5430
|
name: "totalArea",
|
|
5472
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5431
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5473
5432
|
import_ui50.DesignInput,
|
|
5474
5433
|
{
|
|
5475
5434
|
...field,
|
|
@@ -5479,15 +5438,15 @@ var FarmerClusterCreate = () => {
|
|
|
5479
5438
|
)
|
|
5480
5439
|
}
|
|
5481
5440
|
),
|
|
5482
|
-
errors.totalArea && /* @__PURE__ */ (0,
|
|
5441
|
+
errors.totalArea && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.totalArea.message })
|
|
5483
5442
|
] }),
|
|
5484
|
-
/* @__PURE__ */ (0,
|
|
5485
|
-
/* @__PURE__ */ (0,
|
|
5443
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5444
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5486
5445
|
import_ui50.FormField,
|
|
5487
5446
|
{
|
|
5488
5447
|
control,
|
|
5489
5448
|
name: "videoUrl",
|
|
5490
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5449
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5491
5450
|
import_ui50.DesignInput,
|
|
5492
5451
|
{
|
|
5493
5452
|
...field,
|
|
@@ -5497,27 +5456,27 @@ var FarmerClusterCreate = () => {
|
|
|
5497
5456
|
)
|
|
5498
5457
|
}
|
|
5499
5458
|
),
|
|
5500
|
-
errors.videoUrl && /* @__PURE__ */ (0,
|
|
5459
|
+
errors.videoUrl && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.videoUrl.message })
|
|
5501
5460
|
] })
|
|
5502
5461
|
] }),
|
|
5503
|
-
/* @__PURE__ */ (0,
|
|
5504
|
-
/* @__PURE__ */ (0,
|
|
5462
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-12", children: [
|
|
5463
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5505
5464
|
SectionHeader,
|
|
5506
5465
|
{
|
|
5507
5466
|
title: "Contact Button",
|
|
5508
5467
|
subTitle: "Would you like to be reachable? If you enable <em>Show contact button</em> interested people can send you a message via Recodo."
|
|
5509
5468
|
}
|
|
5510
5469
|
),
|
|
5511
|
-
/* @__PURE__ */ (0,
|
|
5470
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5512
5471
|
import_ui50.RadioGroup,
|
|
5513
5472
|
{
|
|
5514
5473
|
orientation: "horizontal",
|
|
5515
5474
|
...register("showContact"),
|
|
5516
5475
|
defaultValue: "false",
|
|
5517
5476
|
required: true,
|
|
5518
|
-
children: /* @__PURE__ */ (0,
|
|
5519
|
-
/* @__PURE__ */ (0,
|
|
5520
|
-
/* @__PURE__ */ (0,
|
|
5477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-4 flex flex-row gap-x-6", children: [
|
|
5478
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
5479
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5521
5480
|
import_ui50.RadioGroupItem,
|
|
5522
5481
|
{
|
|
5523
5482
|
className: "h-5 w-5",
|
|
@@ -5525,10 +5484,10 @@ var FarmerClusterCreate = () => {
|
|
|
5525
5484
|
id: "r1"
|
|
5526
5485
|
}
|
|
5527
5486
|
),
|
|
5528
|
-
/* @__PURE__ */ (0,
|
|
5487
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.Label, { htmlFor: "r1", children: "Show contact button" })
|
|
5529
5488
|
] }),
|
|
5530
|
-
/* @__PURE__ */ (0,
|
|
5531
|
-
/* @__PURE__ */ (0,
|
|
5489
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
5490
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5532
5491
|
import_ui50.RadioGroupItem,
|
|
5533
5492
|
{
|
|
5534
5493
|
className: "h-5 w-5",
|
|
@@ -5536,15 +5495,15 @@ var FarmerClusterCreate = () => {
|
|
|
5536
5495
|
id: "r2"
|
|
5537
5496
|
}
|
|
5538
5497
|
),
|
|
5539
|
-
/* @__PURE__ */ (0,
|
|
5498
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui50.Label, { htmlFor: "r2", children: "Hide contact button" })
|
|
5540
5499
|
] })
|
|
5541
5500
|
] })
|
|
5542
5501
|
}
|
|
5543
5502
|
),
|
|
5544
|
-
errors.showContact && /* @__PURE__ */ (0,
|
|
5503
|
+
errors.showContact && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.showContact.message })
|
|
5545
5504
|
] }),
|
|
5546
|
-
/* @__PURE__ */ (0,
|
|
5547
|
-
/* @__PURE__ */ (0,
|
|
5505
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-12", children: [
|
|
5506
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5548
5507
|
SectionHeader,
|
|
5549
5508
|
{
|
|
5550
5509
|
title: "Cover Photo",
|
|
@@ -5552,63 +5511,25 @@ var FarmerClusterCreate = () => {
|
|
|
5552
5511
|
isRequired: true
|
|
5553
5512
|
}
|
|
5554
5513
|
),
|
|
5555
|
-
/* @__PURE__ */ (0,
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5556
5515
|
import_ui50.FormField,
|
|
5557
5516
|
{
|
|
5558
5517
|
control,
|
|
5559
5518
|
name: "coverImage",
|
|
5560
|
-
render: ({ field }) =>
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
onDrop: (acceptedFiles) => {
|
|
5568
|
-
let selectedFile2 = acceptedFiles[0];
|
|
5569
|
-
setSelectedFile(selectedFile2);
|
|
5570
|
-
let imgURL = URL.createObjectURL(selectedFile2);
|
|
5571
|
-
setSelectedFileUrl(imgURL);
|
|
5572
|
-
field.onChange(selectedFile2);
|
|
5519
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5520
|
+
CoverImageDropzone,
|
|
5521
|
+
{
|
|
5522
|
+
field,
|
|
5523
|
+
onFileSelected: (file) => {
|
|
5524
|
+
setSelectedFile(file);
|
|
5525
|
+
setSelectedFileUrl(URL.createObjectURL(file));
|
|
5573
5526
|
}
|
|
5574
|
-
}
|
|
5575
|
-
|
|
5576
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { ...coverImageDropzone.getInputProps({}) }),
|
|
5577
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "w-full text-center flex-col flex items-center", children: [
|
|
5578
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-16 h-16 bg-accent-primary flex items-center justify-center rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5579
|
-
"svg",
|
|
5580
|
-
{
|
|
5581
|
-
width: "32",
|
|
5582
|
-
height: "32",
|
|
5583
|
-
viewBox: "0 0 32 32",
|
|
5584
|
-
fill: "none",
|
|
5585
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5586
|
-
className: " fill-primary",
|
|
5587
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M19.667 8V5L25.667 11H22.667C20.5603 11 19.667 10.1067 19.667 8ZM22.667 13C19.4403 13 17.667 11.2267 17.667 8V4H10.667C8.00033 4 6.66699 5.33333 6.66699 8V24C6.66699 26.6667 8.00033 28 10.667 28H22.667C25.3337 28 26.667 26.6667 26.667 24V13H22.667Z" })
|
|
5588
|
-
}
|
|
5589
|
-
) }),
|
|
5590
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "pt-6 flex justify-center", children: [
|
|
5591
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "pr-1 text-lg font-normal", children: "Drop your files here or" }),
|
|
5592
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5593
|
-
"label",
|
|
5594
|
-
{
|
|
5595
|
-
htmlFor: "file-upload",
|
|
5596
|
-
className: "relative cursor-pointer rounded-md font-medium text-primary hover:text-primary-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500",
|
|
5597
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-lg font-semibold", children: [
|
|
5598
|
-
" ",
|
|
5599
|
-
"browse"
|
|
5600
|
-
] })
|
|
5601
|
-
}
|
|
5602
|
-
)
|
|
5603
|
-
] }),
|
|
5604
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm font-normal text-grey pt-2", children: "PNG, JPG, GIF up to 10MB. Landscape mode, recommended size 1920x1080px." })
|
|
5605
|
-
] })
|
|
5606
|
-
] }) }) });
|
|
5607
|
-
}
|
|
5527
|
+
}
|
|
5528
|
+
)
|
|
5608
5529
|
}
|
|
5609
5530
|
),
|
|
5610
|
-
errors.coverImage && typeof errors.coverImage.message === "string" && /* @__PURE__ */ (0,
|
|
5611
|
-
selectedFileUrl ? /* @__PURE__ */ (0,
|
|
5531
|
+
errors.coverImage && typeof errors.coverImage.message === "string" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.coverImage.message }),
|
|
5532
|
+
selectedFileUrl ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "pt-5", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5612
5533
|
"img",
|
|
5613
5534
|
{
|
|
5614
5535
|
src: selectedFileUrl,
|
|
@@ -5617,15 +5538,15 @@ var FarmerClusterCreate = () => {
|
|
|
5617
5538
|
}
|
|
5618
5539
|
) }) : null
|
|
5619
5540
|
] }),
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5621
|
-
/* @__PURE__ */ (0,
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-12", children: [
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5622
5543
|
SectionHeader,
|
|
5623
5544
|
{
|
|
5624
5545
|
title: "Location",
|
|
5625
5546
|
subTitle: "Click on the map to place a pin where the Farmer Cluster is located."
|
|
5626
5547
|
}
|
|
5627
5548
|
),
|
|
5628
|
-
/* @__PURE__ */ (0,
|
|
5549
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5629
5550
|
"div",
|
|
5630
5551
|
{
|
|
5631
5552
|
className: "pt-6",
|
|
@@ -5634,7 +5555,7 @@ var FarmerClusterCreate = () => {
|
|
|
5634
5555
|
style: {
|
|
5635
5556
|
color: position !== null && position !== void 0 ? "black" : ""
|
|
5636
5557
|
},
|
|
5637
|
-
children: /* @__PURE__ */ (0,
|
|
5558
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5638
5559
|
MapWithNoSSR2,
|
|
5639
5560
|
{
|
|
5640
5561
|
...{
|
|
@@ -5650,22 +5571,22 @@ var FarmerClusterCreate = () => {
|
|
|
5650
5571
|
}
|
|
5651
5572
|
) })
|
|
5652
5573
|
] }),
|
|
5653
|
-
/* @__PURE__ */ (0,
|
|
5654
|
-
/* @__PURE__ */ (0,
|
|
5574
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-12", children: [
|
|
5575
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5655
5576
|
SectionHeader,
|
|
5656
5577
|
{
|
|
5657
5578
|
title: "About",
|
|
5658
5579
|
subTitle: "Tell us more about your Farmer Cluster."
|
|
5659
5580
|
}
|
|
5660
5581
|
),
|
|
5661
|
-
/* @__PURE__ */ (0,
|
|
5662
|
-
/* @__PURE__ */ (0,
|
|
5663
|
-
/* @__PURE__ */ (0,
|
|
5582
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-1 gap-6 pt-4", children: [
|
|
5583
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5664
5585
|
import_ui50.FormField,
|
|
5665
5586
|
{
|
|
5666
5587
|
control,
|
|
5667
5588
|
name: "description",
|
|
5668
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5589
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5669
5590
|
"textarea",
|
|
5670
5591
|
{
|
|
5671
5592
|
...field,
|
|
@@ -5676,15 +5597,15 @@ var FarmerClusterCreate = () => {
|
|
|
5676
5597
|
)
|
|
5677
5598
|
}
|
|
5678
5599
|
),
|
|
5679
|
-
errors.description && /* @__PURE__ */ (0,
|
|
5600
|
+
errors.description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.description.message })
|
|
5680
5601
|
] }),
|
|
5681
|
-
/* @__PURE__ */ (0,
|
|
5682
|
-
/* @__PURE__ */ (0,
|
|
5602
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5603
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5683
5604
|
import_ui50.FormField,
|
|
5684
5605
|
{
|
|
5685
5606
|
control,
|
|
5686
5607
|
name: "outcomes",
|
|
5687
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5608
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5688
5609
|
"textarea",
|
|
5689
5610
|
{
|
|
5690
5611
|
...field,
|
|
@@ -5695,15 +5616,15 @@ var FarmerClusterCreate = () => {
|
|
|
5695
5616
|
)
|
|
5696
5617
|
}
|
|
5697
5618
|
),
|
|
5698
|
-
errors.outcomes && /* @__PURE__ */ (0,
|
|
5619
|
+
errors.outcomes && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.outcomes.message })
|
|
5699
5620
|
] }),
|
|
5700
|
-
/* @__PURE__ */ (0,
|
|
5701
|
-
/* @__PURE__ */ (0,
|
|
5621
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
5622
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5702
5623
|
import_ui50.FormField,
|
|
5703
5624
|
{
|
|
5704
5625
|
control,
|
|
5705
5626
|
name: "bioDiversityEnhancingMeasures",
|
|
5706
|
-
render: ({ field }) => /* @__PURE__ */ (0,
|
|
5627
|
+
render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5707
5628
|
"textarea",
|
|
5708
5629
|
{
|
|
5709
5630
|
...field,
|
|
@@ -5714,20 +5635,20 @@ var FarmerClusterCreate = () => {
|
|
|
5714
5635
|
)
|
|
5715
5636
|
}
|
|
5716
5637
|
),
|
|
5717
|
-
errors.bioDiversityEnhancingMeasures && /* @__PURE__ */ (0,
|
|
5638
|
+
errors.bioDiversityEnhancingMeasures && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.bioDiversityEnhancingMeasures.message })
|
|
5718
5639
|
] })
|
|
5719
5640
|
] })
|
|
5720
5641
|
] }),
|
|
5721
|
-
/* @__PURE__ */ (0,
|
|
5722
|
-
/* @__PURE__ */ (0,
|
|
5642
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "py-12", children: [
|
|
5643
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5723
5644
|
SectionHeader,
|
|
5724
5645
|
{
|
|
5725
5646
|
title: "Characteristics",
|
|
5726
5647
|
subTitle: "What are the characteristics of your Farmer Cluster?"
|
|
5727
5648
|
}
|
|
5728
5649
|
),
|
|
5729
|
-
/* @__PURE__ */ (0,
|
|
5730
|
-
/* @__PURE__ */ (0,
|
|
5650
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col justify-start items-start gap-y-8 pt-6", children: [
|
|
5651
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5731
5652
|
CharacteristicsSection,
|
|
5732
5653
|
{
|
|
5733
5654
|
title: "Farming Systems",
|
|
@@ -5735,7 +5656,7 @@ var FarmerClusterCreate = () => {
|
|
|
5735
5656
|
name: "farmingSystem"
|
|
5736
5657
|
}
|
|
5737
5658
|
) }),
|
|
5738
|
-
/* @__PURE__ */ (0,
|
|
5659
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5739
5660
|
CharacteristicsSection,
|
|
5740
5661
|
{
|
|
5741
5662
|
title: "Main agricultural areas",
|
|
@@ -5743,7 +5664,7 @@ var FarmerClusterCreate = () => {
|
|
|
5743
5664
|
name: "mainAgriculturalAreas"
|
|
5744
5665
|
}
|
|
5745
5666
|
) }),
|
|
5746
|
-
/* @__PURE__ */ (0,
|
|
5667
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5747
5668
|
CharacteristicsSection,
|
|
5748
5669
|
{
|
|
5749
5670
|
title: "Main crops",
|
|
@@ -5751,7 +5672,7 @@ var FarmerClusterCreate = () => {
|
|
|
5751
5672
|
name: "mainCrops"
|
|
5752
5673
|
}
|
|
5753
5674
|
) }),
|
|
5754
|
-
/* @__PURE__ */ (0,
|
|
5675
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5755
5676
|
CharacteristicsSection,
|
|
5756
5677
|
{
|
|
5757
5678
|
title: "Livestock",
|
|
@@ -5759,7 +5680,7 @@ var FarmerClusterCreate = () => {
|
|
|
5759
5680
|
name: "liveStock"
|
|
5760
5681
|
}
|
|
5761
5682
|
) }),
|
|
5762
|
-
/* @__PURE__ */ (0,
|
|
5683
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5763
5684
|
CharacteristicsSection,
|
|
5764
5685
|
{
|
|
5765
5686
|
title: "Other landscape elements",
|
|
@@ -5767,7 +5688,7 @@ var FarmerClusterCreate = () => {
|
|
|
5767
5688
|
name: "otherLandScapeElements"
|
|
5768
5689
|
}
|
|
5769
5690
|
) }),
|
|
5770
|
-
/* @__PURE__ */ (0,
|
|
5691
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5771
5692
|
CharacteristicsSection,
|
|
5772
5693
|
{
|
|
5773
5694
|
title: "Hunting management",
|
|
@@ -5775,7 +5696,7 @@ var FarmerClusterCreate = () => {
|
|
|
5775
5696
|
name: "huntingManagement"
|
|
5776
5697
|
}
|
|
5777
5698
|
) }),
|
|
5778
|
-
/* @__PURE__ */ (0,
|
|
5699
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5779
5700
|
CharacteristicsSection,
|
|
5780
5701
|
{
|
|
5781
5702
|
title: "Cluster funding",
|
|
@@ -5787,7 +5708,7 @@ var FarmerClusterCreate = () => {
|
|
|
5787
5708
|
] })
|
|
5788
5709
|
] })
|
|
5789
5710
|
] }) }),
|
|
5790
|
-
/* @__PURE__ */ (0,
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5791
5712
|
FarmerClusterPopup,
|
|
5792
5713
|
{
|
|
5793
5714
|
title: "Your information is being processed",
|
|
@@ -5805,10 +5726,10 @@ var import_api_proxy15 = require("@geowiki/api-proxy");
|
|
|
5805
5726
|
var import_async = __toESM(require("react-select/async"));
|
|
5806
5727
|
var import_utils = require("@geowiki/ui/src/lib/utils");
|
|
5807
5728
|
var import_react_select = __toESM(require("react-select"));
|
|
5808
|
-
var
|
|
5809
|
-
var
|
|
5729
|
+
var import_core66 = require("@geowiki/core");
|
|
5730
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5810
5731
|
var SearchFilter = ({ filter, setFilter }) => {
|
|
5811
|
-
const router = (0,
|
|
5732
|
+
const router = (0, import_core66.useRouter)();
|
|
5812
5733
|
const inputRef = import_react32.default.useRef(null);
|
|
5813
5734
|
const [searchText, setSearchText] = (0, import_react32.useState)(filter.search || "");
|
|
5814
5735
|
const [selectedLanguage, setSelectedLanguage] = (0, import_react32.useState)(null);
|
|
@@ -5988,9 +5909,9 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
5988
5909
|
{ value: "lastMonth", label: "Last Month" },
|
|
5989
5910
|
{ value: "lastYear", label: "Last Year" }
|
|
5990
5911
|
];
|
|
5991
|
-
return /* @__PURE__ */ (0,
|
|
5992
|
-
/* @__PURE__ */ (0,
|
|
5993
|
-
/* @__PURE__ */ (0,
|
|
5912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
5913
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("form", { className: "pt-4", onSubmit: (e) => onSearch(e), children: [
|
|
5914
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5994
5915
|
"label",
|
|
5995
5916
|
{
|
|
5996
5917
|
htmlFor: "default-search",
|
|
@@ -5998,8 +5919,8 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
5998
5919
|
children: "Search"
|
|
5999
5920
|
}
|
|
6000
5921
|
),
|
|
6001
|
-
/* @__PURE__ */ (0,
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
5922
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative", children: [
|
|
5923
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6003
5924
|
"svg",
|
|
6004
5925
|
{
|
|
6005
5926
|
"aria-hidden": "true",
|
|
@@ -6008,7 +5929,7 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6008
5929
|
stroke: "currentColor",
|
|
6009
5930
|
viewBox: "0 0 24 24",
|
|
6010
5931
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6011
|
-
children: /* @__PURE__ */ (0,
|
|
5932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6012
5933
|
"path",
|
|
6013
5934
|
{
|
|
6014
5935
|
strokeLinecap: "round",
|
|
@@ -6019,7 +5940,7 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6019
5940
|
)
|
|
6020
5941
|
}
|
|
6021
5942
|
) }),
|
|
6022
|
-
/* @__PURE__ */ (0,
|
|
5943
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6023
5944
|
"input",
|
|
6024
5945
|
{
|
|
6025
5946
|
ref: inputRef,
|
|
@@ -6031,7 +5952,7 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6031
5952
|
onChange: (e) => setSearchText(e.target.value)
|
|
6032
5953
|
}
|
|
6033
5954
|
),
|
|
6034
|
-
searchText && searchText.length ? /* @__PURE__ */ (0,
|
|
5955
|
+
searchText && searchText.length ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6035
5956
|
"div",
|
|
6036
5957
|
{
|
|
6037
5958
|
onClick: () => clearSearch(),
|
|
@@ -6039,11 +5960,11 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6039
5960
|
children: "Clear"
|
|
6040
5961
|
}
|
|
6041
5962
|
) : null,
|
|
6042
|
-
/* @__PURE__ */ (0,
|
|
5963
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { className: "text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2", children: "Search" })
|
|
6043
5964
|
] })
|
|
6044
5965
|
] }),
|
|
6045
|
-
/* @__PURE__ */ (0,
|
|
6046
|
-
/* @__PURE__ */ (0,
|
|
5966
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-full mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 xl:grid-cols-5 gap-4", children: [
|
|
5967
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6047
5968
|
import_react_select.default,
|
|
6048
5969
|
{
|
|
6049
5970
|
placeholder: "Most Recent",
|
|
@@ -6053,7 +5974,7 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6053
5974
|
isClearable: true
|
|
6054
5975
|
}
|
|
6055
5976
|
),
|
|
6056
|
-
/* @__PURE__ */ (0,
|
|
5977
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6057
5978
|
import_async.default,
|
|
6058
5979
|
{
|
|
6059
5980
|
placeholder: "Language",
|
|
@@ -6066,7 +5987,7 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6066
5987
|
isClearable: true
|
|
6067
5988
|
}
|
|
6068
5989
|
),
|
|
6069
|
-
/* @__PURE__ */ (0,
|
|
5990
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6070
5991
|
import_async.default,
|
|
6071
5992
|
{
|
|
6072
5993
|
placeholder: "Topic",
|
|
@@ -6079,7 +6000,7 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6079
6000
|
isClearable: true
|
|
6080
6001
|
}
|
|
6081
6002
|
),
|
|
6082
|
-
/* @__PURE__ */ (0,
|
|
6003
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6083
6004
|
import_async.default,
|
|
6084
6005
|
{
|
|
6085
6006
|
placeholder: "Resource Type",
|
|
@@ -6092,7 +6013,7 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6092
6013
|
isClearable: true
|
|
6093
6014
|
}
|
|
6094
6015
|
),
|
|
6095
|
-
/* @__PURE__ */ (0,
|
|
6016
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6096
6017
|
import_async.default,
|
|
6097
6018
|
{
|
|
6098
6019
|
placeholder: "Audience",
|
|
@@ -6110,39 +6031,39 @@ var SearchFilter = ({ filter, setFilter }) => {
|
|
|
6110
6031
|
};
|
|
6111
6032
|
|
|
6112
6033
|
// src/components/Resource/ResourceCard.tsx
|
|
6113
|
-
var
|
|
6034
|
+
var import_core68 = require("@geowiki/core");
|
|
6114
6035
|
var import_framer_motion = require("framer-motion");
|
|
6115
6036
|
|
|
6116
6037
|
// src/components/Resource/ResourceItem.tsx
|
|
6117
6038
|
var import_ui52 = require("@geowiki/ui");
|
|
6118
|
-
var
|
|
6039
|
+
var import_core67 = require("@geowiki/core");
|
|
6119
6040
|
var import_react33 = require("react");
|
|
6120
|
-
var
|
|
6041
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6121
6042
|
var ResourceItem = ({ resource }) => {
|
|
6122
6043
|
const [open, setOpen] = (0, import_react33.useState)(false);
|
|
6123
|
-
const languages = (0,
|
|
6044
|
+
const languages = (0, import_core67.useLanguages)();
|
|
6124
6045
|
const languageList = languages.data?.filter((lang) => {
|
|
6125
6046
|
return resource.language?.includes(lang.key);
|
|
6126
6047
|
}) || [];
|
|
6127
6048
|
const language = languageList?.length > 1 ? "Multiple" : languageList[0]?.value;
|
|
6128
|
-
const types = (0,
|
|
6049
|
+
const types = (0, import_core67.useResourceType)();
|
|
6129
6050
|
const type = types.data?.find((type2) => type2.key === resource.resourceType);
|
|
6130
|
-
return /* @__PURE__ */ (0,
|
|
6051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
6131
6052
|
"div",
|
|
6132
6053
|
{
|
|
6133
6054
|
className: "w-auto h-[20rem] relative bg-neutral-100 rounded-xl p-6 cursor-pointer lg:h-[27.5rem]",
|
|
6134
6055
|
onClick: () => setOpen(true),
|
|
6135
6056
|
children: [
|
|
6136
|
-
/* @__PURE__ */ (0,
|
|
6137
|
-
/* @__PURE__ */ (0,
|
|
6138
|
-
/* @__PURE__ */ (0,
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "pb-6 flex items-start justify-start ", children: [
|
|
6058
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ResourceIcon, { type: resource.resourceType }),
|
|
6059
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "absolute right-6 flex items-start justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "py-[5px] px-2.5 bg-white rounded-2xl items-center justify-center gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_ui52.Body15sb, { className: "text-primary", children: language }) }) })
|
|
6139
6060
|
] }),
|
|
6140
|
-
/* @__PURE__ */ (0,
|
|
6141
|
-
/* @__PURE__ */ (0,
|
|
6142
|
-
/* @__PURE__ */ (0,
|
|
6143
|
-
/* @__PURE__ */ (0,
|
|
6061
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_ui52.Body16sb, { className: "text-primary", children: type?.value }),
|
|
6062
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "w-full pt-2 space-y-2 flex-col justify-start items-start inline-flex lg:space-y-4", children: [
|
|
6063
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_ui52.H6Design, { className: "w-full line-clamp-4", children: resource.title }),
|
|
6064
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_ui52.Body16, { className: "line-clamp-3 lg:line-clamp-4", children: resource.description })
|
|
6144
6065
|
] }),
|
|
6145
|
-
/* @__PURE__ */ (0,
|
|
6066
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "absolute bottom-6 ", children: resource.link && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6146
6067
|
import_ui52.DesignButton,
|
|
6147
6068
|
{
|
|
6148
6069
|
variant: "externalLink",
|
|
@@ -6152,23 +6073,23 @@ var ResourceItem = ({ resource }) => {
|
|
|
6152
6073
|
children: "View Resource"
|
|
6153
6074
|
}
|
|
6154
6075
|
) }),
|
|
6155
|
-
/* @__PURE__ */ (0,
|
|
6076
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ResourceView_default, { resource, open, setOpen })
|
|
6156
6077
|
]
|
|
6157
6078
|
}
|
|
6158
6079
|
);
|
|
6159
6080
|
};
|
|
6160
6081
|
|
|
6161
6082
|
// src/components/Resource/ResourceCard.tsx
|
|
6162
|
-
var
|
|
6083
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6163
6084
|
var ResourceCard = ({ resource }) => {
|
|
6164
|
-
return /* @__PURE__ */ (0,
|
|
6085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_framer_motion.motion.li, { variants: import_core68.itemVariants, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ResourceItem, { resource }) }, resource.id);
|
|
6165
6086
|
};
|
|
6166
6087
|
|
|
6167
6088
|
// src/components/Resource/ResourceCreate.tsx
|
|
6168
6089
|
var import_api_proxy16 = require("@geowiki/api-proxy");
|
|
6169
|
-
var
|
|
6170
|
-
var
|
|
6171
|
-
var
|
|
6090
|
+
var import_core69 = require("@geowiki/core");
|
|
6091
|
+
var import_core70 = require("@geowiki/core");
|
|
6092
|
+
var import_core71 = require("@geowiki/core");
|
|
6172
6093
|
var import_react_hook_form10 = require("react-hook-form");
|
|
6173
6094
|
var import_sweetalert28 = __toESM(require("sweetalert2"));
|
|
6174
6095
|
var import_ui53 = require("@geowiki/ui");
|
|
@@ -6176,11 +6097,11 @@ var import_ui54 = require("@geowiki/ui");
|
|
|
6176
6097
|
var import_ui55 = require("@geowiki/ui");
|
|
6177
6098
|
var import_ui56 = require("@geowiki/ui");
|
|
6178
6099
|
var import_ui57 = require("@geowiki/ui");
|
|
6179
|
-
var
|
|
6100
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6180
6101
|
var ResourceCreate = ({ resource }) => {
|
|
6181
|
-
const { data: audience } = (0,
|
|
6182
|
-
const { data: topic } = (0,
|
|
6183
|
-
const { data: types } = (0,
|
|
6102
|
+
const { data: audience } = (0, import_core69.useAudience)();
|
|
6103
|
+
const { data: topic } = (0, import_core71.useTopic)();
|
|
6104
|
+
const { data: types } = (0, import_core70.useResourceType)();
|
|
6184
6105
|
const resourceTypes = types?.map((type) => {
|
|
6185
6106
|
return {
|
|
6186
6107
|
label: type.value,
|
|
@@ -6238,9 +6159,9 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6238
6159
|
});
|
|
6239
6160
|
}
|
|
6240
6161
|
};
|
|
6241
|
-
return /* @__PURE__ */ (0,
|
|
6242
|
-
/* @__PURE__ */ (0,
|
|
6243
|
-
/* @__PURE__ */ (0,
|
|
6162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("form", { className: "space-y-8 pt-4", onSubmit: handleSubmit(onSubmit), children: [
|
|
6163
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex justify-end", children: [
|
|
6164
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6244
6165
|
import_ui53.PrimaryButton,
|
|
6245
6166
|
{
|
|
6246
6167
|
type: "button",
|
|
@@ -6249,10 +6170,10 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6249
6170
|
onClick: () => location.href = "/admin/resource"
|
|
6250
6171
|
}
|
|
6251
6172
|
),
|
|
6252
|
-
/* @__PURE__ */ (0,
|
|
6173
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_ui53.PrimaryButton, { type: "submit", label: "Save", style: "primary" })
|
|
6253
6174
|
] }) }),
|
|
6254
|
-
/* @__PURE__ */ (0,
|
|
6255
|
-
/* @__PURE__ */ (0,
|
|
6175
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "grid grid-cols-6 gap-6", children: [
|
|
6176
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 ", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6256
6177
|
import_ui54.OldCustomInput,
|
|
6257
6178
|
{
|
|
6258
6179
|
name: "title",
|
|
@@ -6266,7 +6187,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6266
6187
|
isPlaceholderItalic: true
|
|
6267
6188
|
}
|
|
6268
6189
|
) }),
|
|
6269
|
-
/* @__PURE__ */ (0,
|
|
6190
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6270
6191
|
import_ui57.TextArea,
|
|
6271
6192
|
{
|
|
6272
6193
|
infoText: "description",
|
|
@@ -6281,7 +6202,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6281
6202
|
row: 5
|
|
6282
6203
|
}
|
|
6283
6204
|
) }),
|
|
6284
|
-
/* @__PURE__ */ (0,
|
|
6205
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6285
6206
|
import_ui54.OldCustomInput,
|
|
6286
6207
|
{
|
|
6287
6208
|
name: "author",
|
|
@@ -6295,7 +6216,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6295
6216
|
type: "text"
|
|
6296
6217
|
}
|
|
6297
6218
|
) }),
|
|
6298
|
-
/* @__PURE__ */ (0,
|
|
6219
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6299
6220
|
import_ui54.OldCustomInput,
|
|
6300
6221
|
{
|
|
6301
6222
|
name: "link",
|
|
@@ -6309,7 +6230,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6309
6230
|
type: "text"
|
|
6310
6231
|
}
|
|
6311
6232
|
) }),
|
|
6312
|
-
/* @__PURE__ */ (0,
|
|
6233
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6313
6234
|
import_ui54.OldCustomInput,
|
|
6314
6235
|
{
|
|
6315
6236
|
name: "publisher",
|
|
@@ -6323,7 +6244,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6323
6244
|
type: "text"
|
|
6324
6245
|
}
|
|
6325
6246
|
) }),
|
|
6326
|
-
/* @__PURE__ */ (0,
|
|
6247
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6327
6248
|
import_ui54.OldCustomInput,
|
|
6328
6249
|
{
|
|
6329
6250
|
name: "publishedDate",
|
|
@@ -6337,7 +6258,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6337
6258
|
type: "date"
|
|
6338
6259
|
}
|
|
6339
6260
|
) }),
|
|
6340
|
-
/* @__PURE__ */ (0,
|
|
6261
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6341
6262
|
import_ui55.MultiSelect,
|
|
6342
6263
|
{
|
|
6343
6264
|
name: "resourceType",
|
|
@@ -6351,7 +6272,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6351
6272
|
displayText: "Resource Type"
|
|
6352
6273
|
}
|
|
6353
6274
|
) }),
|
|
6354
|
-
/* @__PURE__ */ (0,
|
|
6275
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6355
6276
|
import_ui56.MultiSelectFreeText,
|
|
6356
6277
|
{
|
|
6357
6278
|
control,
|
|
@@ -6363,7 +6284,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6363
6284
|
displayText: "Language"
|
|
6364
6285
|
}
|
|
6365
6286
|
) }),
|
|
6366
|
-
/* @__PURE__ */ (0,
|
|
6287
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6367
6288
|
import_ui56.MultiSelectFreeText,
|
|
6368
6289
|
{
|
|
6369
6290
|
control,
|
|
@@ -6375,7 +6296,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6375
6296
|
displayText: "Keyword"
|
|
6376
6297
|
}
|
|
6377
6298
|
) }),
|
|
6378
|
-
/* @__PURE__ */ (0,
|
|
6299
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6379
6300
|
import_ui55.MultiSelect,
|
|
6380
6301
|
{
|
|
6381
6302
|
name: "topic",
|
|
@@ -6388,7 +6309,7 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6388
6309
|
displayText: "Topic"
|
|
6389
6310
|
}
|
|
6390
6311
|
) }),
|
|
6391
|
-
/* @__PURE__ */ (0,
|
|
6312
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "col-span-6 sm:col-span-6 lg:col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6392
6313
|
import_ui55.MultiSelect,
|
|
6393
6314
|
{
|
|
6394
6315
|
name: "audience",
|
|
@@ -6406,32 +6327,32 @@ var ResourceCreate = ({ resource }) => {
|
|
|
6406
6327
|
};
|
|
6407
6328
|
|
|
6408
6329
|
// src/components/Resource/ResourceEdit.tsx
|
|
6409
|
-
var
|
|
6330
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6410
6331
|
var ResourceEdit = (_props) => {
|
|
6411
|
-
return /* @__PURE__ */ (0,
|
|
6332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: "Resource Edit" });
|
|
6412
6333
|
};
|
|
6413
6334
|
|
|
6414
6335
|
// src/components/Resource/ResourceList.tsx
|
|
6415
6336
|
var import_api_proxy17 = require("@geowiki/api-proxy");
|
|
6416
|
-
var
|
|
6417
|
-
var
|
|
6418
|
-
var
|
|
6419
|
-
var
|
|
6337
|
+
var import_core72 = require("@geowiki/core");
|
|
6338
|
+
var import_core73 = require("@geowiki/core");
|
|
6339
|
+
var import_core74 = require("@geowiki/core");
|
|
6340
|
+
var import_core75 = require("@geowiki/core");
|
|
6420
6341
|
var import_react_query8 = require("@tanstack/react-query");
|
|
6421
|
-
var
|
|
6342
|
+
var import_core76 = require("@geowiki/core");
|
|
6422
6343
|
var import_react34 = require("react");
|
|
6423
6344
|
var import_react_data_table_component4 = __toESM(require("react-data-table-component"));
|
|
6424
6345
|
var import_sweetalert29 = __toESM(require("sweetalert2"));
|
|
6425
6346
|
var import_ui58 = require("@geowiki/ui");
|
|
6426
|
-
var
|
|
6347
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6427
6348
|
var ResourceList = () => {
|
|
6428
|
-
const { theme } = (0,
|
|
6349
|
+
const { theme } = (0, import_core76.useTheme)();
|
|
6429
6350
|
const queryClient = (0, import_react_query8.useQueryClient)();
|
|
6430
6351
|
var [skip, setSkip] = (0, import_react34.useState)(0);
|
|
6431
6352
|
var [limit, setLimit] = (0, import_react34.useState)(10);
|
|
6432
|
-
var { data: types } = (0,
|
|
6433
|
-
var { data: topics } = (0,
|
|
6434
|
-
const { data, isLoading } = (0,
|
|
6353
|
+
var { data: types } = (0, import_core73.useResourceType)();
|
|
6354
|
+
var { data: topics } = (0, import_core74.useTopic)();
|
|
6355
|
+
const { data, isLoading } = (0, import_core72.useResource)("", "", skip, limit);
|
|
6435
6356
|
const handlePageChange = (page) => {
|
|
6436
6357
|
var skip2 = (page - 1) * limit;
|
|
6437
6358
|
setSkip(skip2);
|
|
@@ -6458,7 +6379,7 @@ var ResourceList = () => {
|
|
|
6458
6379
|
icon: "success"
|
|
6459
6380
|
});
|
|
6460
6381
|
queryClient.invalidateQueries({
|
|
6461
|
-
queryKey: [
|
|
6382
|
+
queryKey: [import_core75.QueryNames.GetResource]
|
|
6462
6383
|
});
|
|
6463
6384
|
}).catch(() => {
|
|
6464
6385
|
import_sweetalert29.default.fire({
|
|
@@ -6491,16 +6412,16 @@ var ResourceList = () => {
|
|
|
6491
6412
|
{
|
|
6492
6413
|
name: "Delete",
|
|
6493
6414
|
button: true,
|
|
6494
|
-
cell: (row) => /* @__PURE__ */ (0,
|
|
6415
|
+
cell: (row) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_ui58.DeleteButton, { onClick: () => deleteWithId(row.id) }),
|
|
6495
6416
|
right: true
|
|
6496
6417
|
}
|
|
6497
6418
|
];
|
|
6498
6419
|
const paginationComponentOptions = {
|
|
6499
6420
|
noRowsPerPage: true
|
|
6500
6421
|
};
|
|
6501
|
-
return /* @__PURE__ */ (0,
|
|
6502
|
-
/* @__PURE__ */ (0,
|
|
6503
|
-
/* @__PURE__ */ (0,
|
|
6422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "pb-8 mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
6423
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "pb-5", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center justify-between flex-wrap sm:flex-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "text-2xl lg:text-[1.75rem] font-semibold leading-[120%]", children: "Resource" }) }) }),
|
|
6424
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6504
6425
|
import_react_data_table_component4.default,
|
|
6505
6426
|
{
|
|
6506
6427
|
theme: theme === "dark" ? "dark" : "default",
|
|
@@ -6521,34 +6442,34 @@ var ResourceList = () => {
|
|
|
6521
6442
|
|
|
6522
6443
|
// src/components/Resource/ResourceDisplayList.tsx
|
|
6523
6444
|
var import_uuid3 = require("uuid");
|
|
6524
|
-
var
|
|
6445
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6525
6446
|
var ResourceDisplayList = ({ resources }) => {
|
|
6526
|
-
return /* @__PURE__ */ (0,
|
|
6447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "px-0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "grid grid-cols-1 lg:grid-cols-4 gap-6", children: resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ResourceItem, { resource }, (0, import_uuid3.v4)())) }) });
|
|
6527
6448
|
};
|
|
6528
6449
|
|
|
6529
6450
|
// src/components/Resource/subtitle-h3-resource-collections.tsx
|
|
6530
6451
|
var import_ui60 = require("@geowiki/ui");
|
|
6531
6452
|
|
|
6532
6453
|
// src/components/Resource/ResourceCollectionItem.tsx
|
|
6533
|
-
var
|
|
6454
|
+
var import_core77 = require("@geowiki/core");
|
|
6534
6455
|
var import_ui59 = require("@geowiki/ui");
|
|
6535
6456
|
var import_lucide_react2 = require("lucide-react");
|
|
6536
|
-
var
|
|
6457
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6537
6458
|
var ResourceCollectionItem = (props) => {
|
|
6538
|
-
return /* @__PURE__ */ (0,
|
|
6539
|
-
/* @__PURE__ */ (0,
|
|
6540
|
-
/* @__PURE__ */ (0,
|
|
6541
|
-
/* @__PURE__ */ (0,
|
|
6542
|
-
/* @__PURE__ */ (0,
|
|
6543
|
-
/* @__PURE__ */ (0,
|
|
6459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "w-auto h-[19.375rem] relative bg-neutral-100 rounded-xl p-6 lg:h-[27.5rem]", children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "pb-2 flex items-start justify-start lg:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_ui59.Icon, { type: props.icon }) }),
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_ui59.Body16sb, { className: "text-primary", children: props.type }),
|
|
6462
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "pt-2 flex-col justify-start items-start space-y-2 inline-flex lg:space-y-4", children: [
|
|
6463
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_ui59.H6Design, { className: "line-clamp-2", children: props.title }),
|
|
6464
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_ui59.Body16, { className: "line-clamp-6", children: props.text })
|
|
6544
6465
|
] }),
|
|
6545
|
-
/* @__PURE__ */ (0,
|
|
6546
|
-
|
|
6466
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "absolute bottom-6 ", children: props.button?.link && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_ui59.DesignButton, { variant: "circle", className: "w-12 h-12 p-2 lg:p-2", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6467
|
+
import_core77.Link,
|
|
6547
6468
|
{
|
|
6548
6469
|
href: props.button.link,
|
|
6549
6470
|
target: props.button.isNewTab ? "_blank" : "_self",
|
|
6550
6471
|
rel: "noreferrer",
|
|
6551
|
-
children: /* @__PURE__ */ (0,
|
|
6472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react2.ArrowRight, { className: "h-6 w-10" })
|
|
6552
6473
|
}
|
|
6553
6474
|
) }) })
|
|
6554
6475
|
] });
|
|
@@ -6556,11 +6477,11 @@ var ResourceCollectionItem = (props) => {
|
|
|
6556
6477
|
|
|
6557
6478
|
// src/components/Resource/ResourceCollectionDisplayList.tsx
|
|
6558
6479
|
var import_uuid4 = require("uuid");
|
|
6559
|
-
var
|
|
6480
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6560
6481
|
var ResourceCollectionDisplayList = ({
|
|
6561
6482
|
resourceCollections
|
|
6562
6483
|
}) => {
|
|
6563
|
-
return /* @__PURE__ */ (0,
|
|
6484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "px-0", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "grid grid-cols-1 lg:grid-cols-4 gap-6", children: resourceCollections.map((resourceCollection) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6564
6485
|
ResourceCollectionItem,
|
|
6565
6486
|
{
|
|
6566
6487
|
title: resourceCollection.title,
|
|
@@ -6574,24 +6495,24 @@ var ResourceCollectionDisplayList = ({
|
|
|
6574
6495
|
};
|
|
6575
6496
|
|
|
6576
6497
|
// src/components/Resource/subtitle-h3-resource-collections.tsx
|
|
6577
|
-
var
|
|
6498
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6578
6499
|
var SubtitleH3ResourceCollections = ({
|
|
6579
6500
|
title,
|
|
6580
6501
|
subtitle,
|
|
6581
6502
|
resourceCollections
|
|
6582
6503
|
}) => {
|
|
6583
|
-
return /* @__PURE__ */ (0,
|
|
6504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
6584
6505
|
"div",
|
|
6585
6506
|
{
|
|
6586
6507
|
className: "lg:space-y-12 lg:container mx-auto ",
|
|
6587
6508
|
"data-component": "SubtitleH3ResourceCollections",
|
|
6588
6509
|
children: [
|
|
6589
|
-
/* @__PURE__ */ (0,
|
|
6590
|
-
/* @__PURE__ */ (0,
|
|
6591
|
-
/* @__PURE__ */ (0,
|
|
6592
|
-
/* @__PURE__ */ (0,
|
|
6510
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "lg:flex lg:justify-between lg:items-start", children: [
|
|
6511
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_ui60.Body18, { className: "lg:w-[15%]", children: subtitle }),
|
|
6512
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_ui60.H3Design, { className: " pt-2 pb-6 lg:py-0 lg:w-[50%]", children: title }),
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "hidden lg:w-[15%] lg:inline" })
|
|
6593
6514
|
] }),
|
|
6594
|
-
/* @__PURE__ */ (0,
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6595
6516
|
ResourceCollectionDisplayList,
|
|
6596
6517
|
{
|
|
6597
6518
|
resourceCollections
|
|
@@ -6603,21 +6524,21 @@ var SubtitleH3ResourceCollections = ({
|
|
|
6603
6524
|
};
|
|
6604
6525
|
|
|
6605
6526
|
// src/components/Resource/ResourcesSelectedTags.tsx
|
|
6606
|
-
var
|
|
6607
|
-
var
|
|
6527
|
+
var import_core78 = require("@geowiki/core");
|
|
6528
|
+
var import_core79 = require("@geowiki/core");
|
|
6608
6529
|
var import_XCircleIcon = __toESM(require("@heroicons/react/24/outline/XCircleIcon"));
|
|
6609
|
-
var
|
|
6530
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6610
6531
|
var ResourcesSelectedTags = () => {
|
|
6611
|
-
const router = (0,
|
|
6532
|
+
const router = (0, import_core79.useRouter)();
|
|
6612
6533
|
const selectedLanguages = router.query.language;
|
|
6613
6534
|
const selectedTopics = router.query.topic;
|
|
6614
6535
|
const selectedResourceTypes = router.query.resourceType;
|
|
6615
6536
|
const selectedAudiences = router.query.audience;
|
|
6616
6537
|
const search = router.query.search;
|
|
6617
|
-
const { data: audiences, isLoading: isAudienceLoading } = (0,
|
|
6618
|
-
const { data: topics, isLoading: isTopicsLoading } = (0,
|
|
6619
|
-
const { data: types, isLoading: isTypesLoading } = (0,
|
|
6620
|
-
const { data: languages, isLoading: isLanguagesLoading } = (0,
|
|
6538
|
+
const { data: audiences, isLoading: isAudienceLoading } = (0, import_core78.useAudience)();
|
|
6539
|
+
const { data: topics, isLoading: isTopicsLoading } = (0, import_core78.useTopic)();
|
|
6540
|
+
const { data: types, isLoading: isTypesLoading } = (0, import_core78.useResourceType)();
|
|
6541
|
+
const { data: languages, isLoading: isLanguagesLoading } = (0, import_core78.useLanguages)();
|
|
6621
6542
|
if (isLanguagesLoading || isAudienceLoading || isTopicsLoading || isTypesLoading) {
|
|
6622
6543
|
return null;
|
|
6623
6544
|
}
|
|
@@ -6638,13 +6559,13 @@ var ResourcesSelectedTags = () => {
|
|
|
6638
6559
|
delete query[key];
|
|
6639
6560
|
router.push({ query });
|
|
6640
6561
|
};
|
|
6641
|
-
return /* @__PURE__ */ (0,
|
|
6642
|
-
selectedLanguagesArray && selectedLanguagesArray.length > 0 && /* @__PURE__ */ (0,
|
|
6643
|
-
/* @__PURE__ */ (0,
|
|
6644
|
-
/* @__PURE__ */ (0,
|
|
6645
|
-
/* @__PURE__ */ (0,
|
|
6562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-wrap gap-1", children: [
|
|
6563
|
+
selectedLanguagesArray && selectedLanguagesArray.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6564
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { children: [
|
|
6565
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "font-medium", children: "Language " }),
|
|
6566
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: selectedLanguagesArray?.map((language) => language.value).join(", ") })
|
|
6646
6567
|
] }),
|
|
6647
|
-
/* @__PURE__ */ (0,
|
|
6568
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6648
6569
|
import_XCircleIcon.default,
|
|
6649
6570
|
{
|
|
6650
6571
|
className: "h-5 min-h-5 min-w-5 cursor-pointer",
|
|
@@ -6652,12 +6573,12 @@ var ResourcesSelectedTags = () => {
|
|
|
6652
6573
|
}
|
|
6653
6574
|
)
|
|
6654
6575
|
] }) }),
|
|
6655
|
-
selectedTopicsArray && selectedTopicsArray.length > 0 && /* @__PURE__ */ (0,
|
|
6656
|
-
/* @__PURE__ */ (0,
|
|
6657
|
-
/* @__PURE__ */ (0,
|
|
6658
|
-
/* @__PURE__ */ (0,
|
|
6576
|
+
selectedTopicsArray && selectedTopicsArray.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6577
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { children: [
|
|
6578
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "font-medium", children: "Topic " }),
|
|
6579
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: selectedTopicsArray?.map((topic) => topic.value).join(", ") })
|
|
6659
6580
|
] }),
|
|
6660
|
-
/* @__PURE__ */ (0,
|
|
6581
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6661
6582
|
import_XCircleIcon.default,
|
|
6662
6583
|
{
|
|
6663
6584
|
className: "h-5 min-h-5 min-w-5 cursor-pointer",
|
|
@@ -6665,12 +6586,12 @@ var ResourcesSelectedTags = () => {
|
|
|
6665
6586
|
}
|
|
6666
6587
|
)
|
|
6667
6588
|
] }) }),
|
|
6668
|
-
selectedResourceTypesArray && selectedResourceTypesArray.length > 0 && /* @__PURE__ */ (0,
|
|
6669
|
-
/* @__PURE__ */ (0,
|
|
6670
|
-
/* @__PURE__ */ (0,
|
|
6671
|
-
/* @__PURE__ */ (0,
|
|
6589
|
+
selectedResourceTypesArray && selectedResourceTypesArray.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6590
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { children: [
|
|
6591
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "font-medium", children: "Resource Type " }),
|
|
6592
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: selectedResourceTypesArray?.map((type) => type.value).join(", ") })
|
|
6672
6593
|
] }),
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
6594
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6674
6595
|
import_XCircleIcon.default,
|
|
6675
6596
|
{
|
|
6676
6597
|
className: "h-5 min-h-5 min-w-5 cursor-pointer",
|
|
@@ -6678,12 +6599,12 @@ var ResourcesSelectedTags = () => {
|
|
|
6678
6599
|
}
|
|
6679
6600
|
)
|
|
6680
6601
|
] }) }),
|
|
6681
|
-
selectedAudiencesArray && selectedAudiencesArray.length > 0 && /* @__PURE__ */ (0,
|
|
6682
|
-
/* @__PURE__ */ (0,
|
|
6683
|
-
/* @__PURE__ */ (0,
|
|
6684
|
-
/* @__PURE__ */ (0,
|
|
6602
|
+
selectedAudiencesArray && selectedAudiencesArray.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6603
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { children: [
|
|
6604
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "font-medium", children: "Audience " }),
|
|
6605
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: selectedAudiencesArray?.map((audience) => audience.value).join(", ") })
|
|
6685
6606
|
] }),
|
|
6686
|
-
/* @__PURE__ */ (0,
|
|
6607
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6687
6608
|
import_XCircleIcon.default,
|
|
6688
6609
|
{
|
|
6689
6610
|
className: "h-5 min-h-5 min-w-5 cursor-pointer",
|
|
@@ -6691,12 +6612,12 @@ var ResourcesSelectedTags = () => {
|
|
|
6691
6612
|
}
|
|
6692
6613
|
)
|
|
6693
6614
|
] }) }),
|
|
6694
|
-
search && /* @__PURE__ */ (0,
|
|
6695
|
-
/* @__PURE__ */ (0,
|
|
6696
|
-
/* @__PURE__ */ (0,
|
|
6697
|
-
/* @__PURE__ */ (0,
|
|
6615
|
+
search && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex flex-col justify-center px-2.5 py-2 text-sm leading-5 text-black border border-solid border-zinc-300 rounded-[40px]", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6616
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { children: [
|
|
6617
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "font-medium", children: "Search " }),
|
|
6618
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: search })
|
|
6698
6619
|
] }),
|
|
6699
|
-
/* @__PURE__ */ (0,
|
|
6620
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6700
6621
|
import_XCircleIcon.default,
|
|
6701
6622
|
{
|
|
6702
6623
|
className: "h-5 min-h-5 min-w-5 cursor-pointer",
|
|
@@ -6708,9 +6629,9 @@ var ResourcesSelectedTags = () => {
|
|
|
6708
6629
|
};
|
|
6709
6630
|
|
|
6710
6631
|
// src/components/Resource/KeyResourceItem.tsx
|
|
6711
|
-
var
|
|
6632
|
+
var import_core80 = require("@geowiki/core");
|
|
6712
6633
|
var import_ui61 = require("@geowiki/ui");
|
|
6713
|
-
var
|
|
6634
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6714
6635
|
var KeyResourceItem = ({
|
|
6715
6636
|
title,
|
|
6716
6637
|
subtitle,
|
|
@@ -6718,8 +6639,8 @@ var KeyResourceItem = ({
|
|
|
6718
6639
|
imageId,
|
|
6719
6640
|
imagePath
|
|
6720
6641
|
}) => {
|
|
6721
|
-
return /* @__PURE__ */ (0,
|
|
6722
|
-
imageId && /* @__PURE__ */ (0,
|
|
6642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core80.Link, { href: path, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "w-full flex-col justify-start items-start inline-flex", children: [
|
|
6643
|
+
imageId && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6723
6644
|
import_ui61.ApiImage,
|
|
6724
6645
|
{
|
|
6725
6646
|
imageId,
|
|
@@ -6728,7 +6649,7 @@ var KeyResourceItem = ({
|
|
|
6728
6649
|
className: "w-full h-[260px] rounded-xl object-cover"
|
|
6729
6650
|
}
|
|
6730
6651
|
),
|
|
6731
|
-
imagePath && /* @__PURE__ */ (0,
|
|
6652
|
+
imagePath && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6732
6653
|
import_ui61.CmsImage,
|
|
6733
6654
|
{
|
|
6734
6655
|
src: imagePath,
|
|
@@ -6738,16 +6659,16 @@ var KeyResourceItem = ({
|
|
|
6738
6659
|
className: "w-full h-[260px] rounded-xl object-cover"
|
|
6739
6660
|
}
|
|
6740
6661
|
),
|
|
6741
|
-
/* @__PURE__ */ (0,
|
|
6742
|
-
/* @__PURE__ */ (0,
|
|
6662
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_ui61.Body16sb, { className: "pt-4 pb-2 text-primary", children: subtitle }),
|
|
6663
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_ui61.H9Design, { children: title })
|
|
6743
6664
|
] }) });
|
|
6744
6665
|
};
|
|
6745
6666
|
|
|
6746
6667
|
// src/components/Resource/KeyResourceItemList.tsx
|
|
6747
6668
|
var import_uuid5 = require("uuid");
|
|
6748
|
-
var
|
|
6669
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6749
6670
|
var KeyResourceItemList = ({ keyResources }) => {
|
|
6750
|
-
return /* @__PURE__ */ (0,
|
|
6671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "container mx-auto px-0", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-x-6 gap-y-5 lg:gap-y-10", children: keyResources.map((keyResource) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6751
6672
|
KeyResourceItem,
|
|
6752
6673
|
{
|
|
6753
6674
|
title: keyResource.title,
|
|
@@ -6762,79 +6683,78 @@ var KeyResourceItemList = ({ keyResources }) => {
|
|
|
6762
6683
|
|
|
6763
6684
|
// src/components/Resource/SubtitleH3KeyResources.tsx
|
|
6764
6685
|
var import_ui62 = require("@geowiki/ui");
|
|
6765
|
-
var
|
|
6686
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6766
6687
|
var SubtitleH3KeyResources = ({
|
|
6767
6688
|
title,
|
|
6768
6689
|
subtitle,
|
|
6769
6690
|
keyResources
|
|
6770
6691
|
}) => {
|
|
6771
|
-
return /* @__PURE__ */ (0,
|
|
6692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6772
6693
|
"div",
|
|
6773
6694
|
{
|
|
6774
6695
|
className: "lg:space-y-14 lg:container mx-auto lg:pt-20 pt-5",
|
|
6775
6696
|
"data-component": "SubtitleH3KeyResources",
|
|
6776
6697
|
children: [
|
|
6777
|
-
/* @__PURE__ */ (0,
|
|
6778
|
-
/* @__PURE__ */ (0,
|
|
6779
|
-
/* @__PURE__ */ (0,
|
|
6780
|
-
/* @__PURE__ */ (0,
|
|
6698
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "lg:flex lg:justify-between lg:items-start", children: [
|
|
6699
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_ui62.Body18, { className: "lg:w-[15%]", children: subtitle }),
|
|
6700
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_ui62.H3Design, { className: " pt-2 pb-6 lg:py-0 lg:w-[50%]", children: title }),
|
|
6701
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "hidden lg:w-[15%] lg:inline" })
|
|
6781
6702
|
] }),
|
|
6782
|
-
/* @__PURE__ */ (0,
|
|
6703
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(KeyResourceItemList, { keyResources })
|
|
6783
6704
|
]
|
|
6784
6705
|
}
|
|
6785
6706
|
);
|
|
6786
6707
|
};
|
|
6787
6708
|
|
|
6788
6709
|
// src/components/User/index.tsx
|
|
6789
|
-
var
|
|
6710
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6790
6711
|
var UserInfoPage = () => {
|
|
6791
|
-
return /* @__PURE__ */ (0,
|
|
6792
|
-
/* @__PURE__ */ (0,
|
|
6793
|
-
/* @__PURE__ */ (0,
|
|
6712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "container mx-auto h-64", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "pt-5 mt-5 pb-24 px-4 py-5 lg:px-0 lg:py-2 md:px-2 md:py-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
|
|
6713
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("strong", { children: "Welcome Back!" }),
|
|
6714
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "pt-5", children: "Here, you can manage your Farmer Clusters, add Farmer Cluster profiles, images, stories and news. You can also manage basic personal settings, such as changing your display name or password." })
|
|
6794
6715
|
] }) }) }) }) });
|
|
6795
6716
|
};
|
|
6796
6717
|
|
|
6797
6718
|
// src/components/User/UpdateUser.tsx
|
|
6798
6719
|
var import_react35 = require("react");
|
|
6799
|
-
var
|
|
6720
|
+
var import_core81 = require("@geowiki/core");
|
|
6800
6721
|
var import_ui63 = require("@geowiki/ui");
|
|
6801
6722
|
var import_outline8 = require("@heroicons/react/24/outline");
|
|
6802
6723
|
var import_ui64 = require("@geowiki/ui");
|
|
6803
6724
|
var import_ui65 = require("@geowiki/ui");
|
|
6804
|
-
var
|
|
6725
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6805
6726
|
var UpdateUser = () => {
|
|
6806
|
-
const { data, isLoading } = (0,
|
|
6727
|
+
const { data, isLoading } = (0, import_core81.useUserProfileGet)();
|
|
6807
6728
|
const [ChangeDisplayName, setChangeDisplayName] = (0, import_react35.useState)(false);
|
|
6808
6729
|
const [ChangePassword, setChangePassword] = (0, import_react35.useState)(false);
|
|
6809
|
-
if (isLoading || data === void 0)
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: " Your Email Address" }),
|
|
6730
|
+
if (isLoading || data === void 0) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui63.LoaderFull, {});
|
|
6731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "container mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pt-4 px-4 py-5 lg:px-2 lg:py-2 md:px-2 md:py-2", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
|
|
6732
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "pt-5", children: [
|
|
6733
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: " Your Email Address" }),
|
|
6814
6734
|
" : ",
|
|
6815
6735
|
data.email
|
|
6816
6736
|
] }),
|
|
6817
|
-
/* @__PURE__ */ (0,
|
|
6818
|
-
/* @__PURE__ */ (0,
|
|
6737
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "pt-5", children: [
|
|
6738
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: "Your Display Name" }),
|
|
6819
6739
|
" : ",
|
|
6820
6740
|
data.name,
|
|
6821
6741
|
" ",
|
|
6822
6742
|
data.surname,
|
|
6823
|
-
/* @__PURE__ */ (0,
|
|
6743
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-xs", children: "Preferably, your display name is your First and Last Name." })
|
|
6824
6744
|
] }),
|
|
6825
|
-
/* @__PURE__ */ (0,
|
|
6745
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pt-5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6826
6746
|
"button",
|
|
6827
6747
|
{
|
|
6828
6748
|
className: ChangeDisplayName ? "focus:bg-primary-600 focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:outline-none focus:ring-0 inline-block rounded bg-secondary px-6 pb-2 pt-2.5 text-xs font-medium uppercase leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]" : "inline-block rounded bg-secondary px-6 pb-2 pt-2.5 text-xs font-medium uppercase leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]",
|
|
6829
6749
|
type: "button",
|
|
6830
6750
|
onClick: () => setChangeDisplayName(!ChangeDisplayName),
|
|
6831
|
-
children: /* @__PURE__ */ (0,
|
|
6751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex", children: [
|
|
6832
6752
|
"Change Display Name",
|
|
6833
|
-
ChangeDisplayName ? /* @__PURE__ */ (0,
|
|
6753
|
+
ChangeDisplayName ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_outline8.ChevronDownIcon, { className: "h-4 w-4 ml-5 text-white" }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_outline8.ChevronRightIcon, { className: "h-4 w-4 ml-5 text-white" })
|
|
6834
6754
|
] })
|
|
6835
6755
|
}
|
|
6836
6756
|
) }),
|
|
6837
|
-
ChangeDisplayName && /* @__PURE__ */ (0,
|
|
6757
|
+
ChangeDisplayName && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6838
6758
|
import_ui64.UpdateUserProfile,
|
|
6839
6759
|
{
|
|
6840
6760
|
ShowProfile: ChangeDisplayName,
|
|
@@ -6842,19 +6762,19 @@ var UpdateUser = () => {
|
|
|
6842
6762
|
data
|
|
6843
6763
|
}
|
|
6844
6764
|
) }),
|
|
6845
|
-
/* @__PURE__ */ (0,
|
|
6765
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "pt-5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6846
6766
|
"button",
|
|
6847
6767
|
{
|
|
6848
6768
|
className: ChangePassword ? "focus:bg-primary-600 focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] focus:outline-none focus:ring-0 inline-block rounded bg-secondary px-6 pb-2 pt-2.5 text-xs font-medium uppercase leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]" : "inline-block rounded bg-secondary px-6 pb-2 pt-2.5 text-xs font-medium uppercase leading-normal text-white shadow-[0_4px_9px_-4px_#3b71ca] transition duration-150 ease-in-out hover:bg-primary-600 hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] active:bg-primary-700 active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.3),0_4px_18px_0_rgba(59,113,202,0.2)] dark:shadow-[0_4px_9px_-4px_rgba(59,113,202,0.5)] dark:hover:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:focus:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)] dark:active:shadow-[0_8px_9px_-4px_rgba(59,113,202,0.2),0_4px_18px_0_rgba(59,113,202,0.1)]",
|
|
6849
6769
|
type: "button",
|
|
6850
6770
|
onClick: () => setChangePassword(!ChangePassword),
|
|
6851
|
-
children: /* @__PURE__ */ (0,
|
|
6771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex", children: [
|
|
6852
6772
|
"Change Password",
|
|
6853
|
-
ChangePassword ? /* @__PURE__ */ (0,
|
|
6773
|
+
ChangePassword ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_outline8.ChevronDownIcon, { className: "h-4 w-4 ml-5 text-white" }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_outline8.ChevronRightIcon, { className: "h-4 w-4 ml-5 text-white" })
|
|
6854
6774
|
] })
|
|
6855
6775
|
}
|
|
6856
6776
|
) }),
|
|
6857
|
-
ChangePassword && /* @__PURE__ */ (0,
|
|
6777
|
+
ChangePassword && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6858
6778
|
import_ui65.UpdatePassword,
|
|
6859
6779
|
{
|
|
6860
6780
|
ShowUpdatePassword: ChangePassword,
|
|
@@ -6866,26 +6786,26 @@ var UpdateUser = () => {
|
|
|
6866
6786
|
|
|
6867
6787
|
// src/components/FeatureResources/FeatureResources.tsx
|
|
6868
6788
|
var import_ui66 = require("@geowiki/ui");
|
|
6869
|
-
var
|
|
6870
|
-
var
|
|
6789
|
+
var import_core82 = require("@geowiki/core");
|
|
6790
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6871
6791
|
var FeatureResources = (props) => {
|
|
6872
|
-
return /* @__PURE__ */ (0,
|
|
6873
|
-
/* @__PURE__ */ (0,
|
|
6874
|
-
/* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
6792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: " w-auto h-[15rem] relative bg-white rounded-xl p-6 lg:h-[18rem] lg:max-w-[400px]", children: [
|
|
6793
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-start justify-between ", children: [
|
|
6794
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ResourceIcon, { type: props.imageType }),
|
|
6795
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_ui66.Body15sb, { className: "text-primary", children: props.tag })
|
|
6876
6796
|
] }),
|
|
6877
|
-
/* @__PURE__ */ (0,
|
|
6878
|
-
/* @__PURE__ */ (0,
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
6797
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "pt-4 flex-col justify-start items-start space-y-2 inline-flex lg:pt-6 lg:space-y-4", children: [
|
|
6798
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_ui66.H8Design, { children: props.title }),
|
|
6799
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_ui66.Body16, { children: props.text })
|
|
6880
6800
|
] }),
|
|
6881
|
-
/* @__PURE__ */ (0,
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "absolute bottom-6 ", children: props.button?.link && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6882
6802
|
import_ui66.DesignButton,
|
|
6883
6803
|
{
|
|
6884
6804
|
variant: "externalLink",
|
|
6885
6805
|
size: "sm",
|
|
6886
6806
|
className: "h-auto p-0 lg:p-0",
|
|
6887
|
-
children: /* @__PURE__ */ (0,
|
|
6888
|
-
|
|
6807
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6808
|
+
import_core82.Link,
|
|
6889
6809
|
{
|
|
6890
6810
|
href: props.button.link,
|
|
6891
6811
|
target: props.button.isNewTab ? "_blank" : "_self",
|
|
@@ -6899,9 +6819,9 @@ var FeatureResources = (props) => {
|
|
|
6899
6819
|
};
|
|
6900
6820
|
|
|
6901
6821
|
// src/components/FeatureResources/FeatureResourcesList.tsx
|
|
6902
|
-
var
|
|
6822
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6903
6823
|
var FeatureResourcesList = ({ featureResources }) => {
|
|
6904
|
-
return /* @__PURE__ */ (0,
|
|
6824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "container mx-auto px-0", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: featureResources?.map((featureResource) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6905
6825
|
FeatureResources,
|
|
6906
6826
|
{
|
|
6907
6827
|
title: featureResource.title,
|
|
@@ -6917,15 +6837,15 @@ var FeatureResourcesList = ({ featureResources }) => {
|
|
|
6917
6837
|
// src/components/FeatureResources/subtitle-h3-body-special-feature-resource-collections.tsx
|
|
6918
6838
|
var import_ui67 = require("@geowiki/ui");
|
|
6919
6839
|
var import_react36 = require("react");
|
|
6920
|
-
var
|
|
6921
|
-
var
|
|
6840
|
+
var import_core83 = require("@geowiki/core");
|
|
6841
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6922
6842
|
var SubtitleH3BodySpecialFeatureResourceCollections = ({
|
|
6923
6843
|
title,
|
|
6924
6844
|
subtitle,
|
|
6925
6845
|
description,
|
|
6926
6846
|
featureResources
|
|
6927
6847
|
}) => {
|
|
6928
|
-
const router = (0,
|
|
6848
|
+
const router = (0, import_core83.useRouter)();
|
|
6929
6849
|
(0, import_react36.useEffect)(() => {
|
|
6930
6850
|
if (typeof window !== "undefined" && router.asPath.includes("#")) {
|
|
6931
6851
|
const id = router.asPath.split("#")[1];
|
|
@@ -6937,18 +6857,18 @@ var SubtitleH3BodySpecialFeatureResourceCollections = ({
|
|
|
6937
6857
|
}, 100);
|
|
6938
6858
|
}
|
|
6939
6859
|
}, [router.asPath]);
|
|
6940
|
-
return /* @__PURE__ */ (0,
|
|
6941
|
-
/* @__PURE__ */ (0,
|
|
6942
|
-
/* @__PURE__ */ (0,
|
|
6943
|
-
/* @__PURE__ */ (0,
|
|
6944
|
-
/* @__PURE__ */ (0,
|
|
6945
|
-
/* @__PURE__ */ (0,
|
|
6946
|
-
/* @__PURE__ */ (0,
|
|
6947
|
-
/* @__PURE__ */ (0,
|
|
6860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { id: "special-feature-resources", children: [
|
|
6861
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("a", { href: "#special-feature-resources" }),
|
|
6862
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "bg-accent-secondary rounded-xl mt-6 lg:mt-20", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "container mx-auto py-6 px-5 space-y-6 lg:pt-16 lg:pb-12 lg:px-12 lg:space-y-12", children: [
|
|
6863
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "lg:flex justify-between items-start", children: [
|
|
6864
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_ui67.Body18, { className: "pt-2 lg:pt-0 lg:w-[15%]", children: subtitle }),
|
|
6865
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-4 lg:w-[50%] lg:space-y-6", children: [
|
|
6866
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_ui67.H3Design, { children: title }),
|
|
6867
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_ui67.Body18, { children: description })
|
|
6948
6868
|
] }),
|
|
6949
|
-
/* @__PURE__ */ (0,
|
|
6869
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "hidden lg:w-[15%] lg:inline" })
|
|
6950
6870
|
] }),
|
|
6951
|
-
/* @__PURE__ */ (0,
|
|
6871
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FeatureResourcesList, { featureResources })
|
|
6952
6872
|
] }) })
|
|
6953
6873
|
] });
|
|
6954
6874
|
};
|
|
@@ -6980,7 +6900,6 @@ var SubtitleH3BodySpecialFeatureResourceCollections = ({
|
|
|
6980
6900
|
ResourceIcon,
|
|
6981
6901
|
ResourceItem,
|
|
6982
6902
|
ResourceList,
|
|
6983
|
-
ResourceTag,
|
|
6984
6903
|
ResourcesQuickFind,
|
|
6985
6904
|
ResourcesSelectedTags,
|
|
6986
6905
|
SearchFilter,
|