Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TM-874] site profile non monitoring partner #253

Merged
merged 21 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
414695b
[TM-874] add component map and panel in Site overview
dottyy Jun 12, 2024
f471747
[TM-874] estid style in Site Area
dottyy Jun 12, 2024
e34dca4
[TM-874] edit style in Site Area
dottyy Jun 12, 2024
1352823
start merging map to reuse
egrojMonroy Jun 12, 2024
68a8123
[TM-874] edit style in map overview site
dottyy Jun 12, 2024
a5c3272
[TM-874] add site map
egrojMonroy Jun 12, 2024
a654979
[TM-874] remove unused code
cesarLima1 Jun 12, 2024
ef9a676
Merge branch 'staging' into feat/TM-874-Site-Profile-Non-Monitoring-P…
cesarLima1 Jun 12, 2024
6649591
[TM-874] add constant with statusEnum
cesarLima1 Jun 12, 2024
ae5bdad
[TM-874] edit value items in mapSidePanel stories
dottyy Jun 12, 2024
88460a4
[TM-874] remove console.log
cesarLima1 Jun 12, 2024
84687e6
[TM-874] remove logs
cesarLima1 Jun 12, 2024
8a0e590
[TM-874] solved PR - add transifex
dottyy Jun 12, 2024
a6d7941
[TM-874] solved PR - add transifex
dottyy Jun 12, 2024
eacd9de
[TM-874] solved PR - add transifex and remove mocked data
dottyy Jun 12, 2024
5f38294
[TM-874] solved PR - add transifex and remove mocked data
dottyy Jun 12, 2024
02249ca
[TM-874] solved PR - add transifex and change ??
dottyy Jun 12, 2024
02017fc
[TM-874] solved PR - add transifex and remove mocked data
dottyy Jun 12, 2024
7968367
[TM-874] solved PR - add transifex and remove mocked data
dottyy Jun 13, 2024
67e4a10
[TM-874] download site geojson
cesarLima1 Jun 13, 2024
1a6e37f
Merge branch 'feat/TM-874-Site-Profile-Non-Monitoring-Partner' of htt…
cesarLima1 Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/components/elements/Map-mapbox/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,7 @@ export const MapContainer = ({
};

return (
<div
ref={mapContainer}
className={twMerge("h-[500px] wide:h-[700px]", className)}
id={`id_map_${Math.random().toString(36).substr(2, 9)}`}
>
<div ref={mapContainer} className={twMerge("h-[500px] wide:h-[700px]", className)} id="map-container">
<When condition={hasControls}>
<When condition={polygonFromMap?.isOpen}>
<ControlGroup position="top-center">
Expand Down
1 change: 0 additions & 1 deletion src/components/elements/Map-mapbox/hooks/useMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const useMap = (onSave?: (geojson: any, record: any) => void) => {
const initMap = () => {
if (map.current) return;

console.log("map.current", map.current);
map.current = new mapboxgl.Map({
container: mapContainer.current as HTMLDivElement,
style: MAP_STYLE,
Expand Down
42 changes: 23 additions & 19 deletions src/components/elements/MapPolygonPanel/AttributeInformation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useT } from "@transifex/react";

import Dropdown from "@/components/elements/Inputs/Dropdown/Dropdown";
import Input from "@/components/elements/Inputs/Input/Input";

Expand Down Expand Up @@ -67,81 +69,83 @@ const dropdownOptionsTree = [
}
];
const AttributeInformation = () => {
const t = useT();

return (
<div className="flex flex-col gap-4">
<Input
label="Polygon Name"
label={t("Polygon Name")}
labelClassName="capitalize text-white"
labelVariant="text-14-light"
placeholder="Input Polygon Name"
placeholder={t("Input Polygon Name")}
type="text"
name=""
/>
<label className="flex flex-col gap-2">
<Text variant="text-14-light" className="text-white">
Plant Start Date
{t("Plant Start Date")}
</Text>
<input
type="date"
className="rounded-lg border-neutral-200 focus:border-primary focus:shadow-none focus:ring-transparent"
placeholder="Input Plant Start Date"
placeholder={t("Input Plant Start Date")}
/>
</label>
<label className="flex flex-col gap-2">
<Text variant="text-14-light" className="text-white">
Plant End Date
{t("Plant End Date")}
</Text>
<input
type="date"
className="rounded-lg border-neutral-200 focus:border-primary focus:shadow-none focus:ring-transparent"
placeholder="Input Plant Start Date"
placeholder={t("Input Plant Start Date")}
/>
</label>
<Dropdown
multiSelect
label="Restoration Practice"
label={t("Restoration Practice")}
labelClassName="capitalize text-white"
labelVariant="text-14-light"
placeholder="Select Restoration Practice"
placeholder={t("Select Restoration Practice")}
options={dropdownOptionsRestoration}
value={["Planting Complete"]}
value={[t("Planting Complete")]}
onChange={() => {}}
className="bg-white"
/>
<Dropdown
label="Target Land Use System"
label={t("Target Land Use System")}
labelClassName="capitalize text-white"
labelVariant="text-14-light"
placeholder="Select Target Land Use System"
placeholder={t("Select Target Land Use System")}
options={dropdownOptionsTarget}
value={["Planting Complete"]}
value={[t("Planting Complete")]}
onChange={() => {}}
className="bg-white"
/>
<Dropdown
multiSelect
label="Tree Distribution"
label={t("Tree Distribution")}
labelClassName="capitalize text-white"
labelVariant="text-14-light"
placeholder="Select Tree Distribution"
placeholder={t("Select Tree Distribution")}
options={dropdownOptionsTree}
value={["Planting Complete"]}
value={[t("Planting Complete")]}
onChange={() => {}}
className="bg-white"
/>
<Input
label="Trees Planted"
label={t("Trees Planted")}
labelClassName="capitalize text-white"
labelVariant="text-14-light"
placeholder="Input Trees Planted"
placeholder={t("Input Trees Planted")}
type="text"
name=""
/>
<Input
label="Estimated Area"
label={t("Estimated Area")}
labelClassName="capitalize text-white"
labelVariant="text-14-light"
placeholder="Input Estimated Area"
placeholder={t("Input Estimated Area")}
type="text"
name=""
/>
Expand Down
40 changes: 22 additions & 18 deletions src/components/elements/MapPolygonPanel/ChecklistInformation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useT } from "@transifex/react";

import Icon, { IconNames } from "@/components/extensive/Icon/Icon";
import ModalWithMap from "@/components/extensive/Modal/ModalWithMap";
import { useModalContext } from "@/context/modal.provider";
Expand All @@ -7,72 +9,74 @@ import Text from "../Text/Text";

const ChecklistInformation = () => {
const { openModal, closeModal } = useModalContext();
const t = useT();

const openFormModalHandlerRequestPolygonSupport = () => {
openModal(
<ModalWithMap
title="Request Support"
title={t("Request Support")}
onClose={closeModal}
content="Faja Lobi Project&nbsp;&nbsp;•&nbsp;&nbsp;Priceless Planet Coalition"
primaryButtonText="Submit"
primaryButtonText={t("Submit")}
content="-&nbsp;&nbsp;•&nbsp;&nbsp;-"
primaryButtonProps={{ className: "px-8 py-3", variant: "primary", onClick: closeModal }}
></ModalWithMap>
);
};
return (
<div className="text-white">
<Text variant="text-14-bold">3 out 14</Text>
<Text variant="text-14-light">Validation criteria are not met</Text>
<Text variant="text-14-bold">3 {t("out")} 14</Text>
<Text variant="text-14-light">{t("Validation criteria are not met")}</Text>
<Button variant="primary" className="mt-4" onClick={openFormModalHandlerRequestPolygonSupport}>
request support
{t("request support")}
</Button>
<div className="mt-3 grid gap-3">
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.CHECK_PROGRESSBAR} className="h-4 w-4 text-green-400 lg:h-5 lg:w-5" />
GeoJSON Format
{t("GeoJSON Format")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.CHECK_PROGRESSBAR} className="h-4 w-4 text-green-400 lg:h-5 lg:w-5" />
WGS84 Projection
{t("WGS84 Projection")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.IC_ERROR} className="h-5 w-5 lg:h-6 lg:w-6" />
Earth Location
{t("Earth Location")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.IC_ERROR} className="h-5 w-5 lg:h-6 lg:w-6" />
Country
{t("Country")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.CHECK_PROGRESSBAR} className="h-4 w-4 text-green-400 lg:h-5 lg:w-5" />
Reasonable Size Self-Intersecting Topology
{t("Reasonable Size Self-Intersecting Topology")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.IC_ERROR} className="h-5 w-5 lg:h-6 lg:w-6" />
Overlapping Polygons
{t("Overlapping Polygons")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.CHECK_PROGRESSBAR} className="h-4 w-4 text-green-400 lg:h-5 lg:w-5" />
Spike
{t("Spike")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.CHECK_PROGRESSBAR} className="h-4 w-4 text-green-400 lg:h-5 lg:w-5" />
Polygon Integrity
{t("Polygon Integrity")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.CHECK_PROGRESSBAR} className="h-4 w-4 text-green-400 lg:h-5 lg:w-5" />
GeoJSON Format
{t("GeoJSON Format")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.CHECK_PROGRESSBAR} className="h-4 w-4 text-green-400 lg:h-5 lg:w-5" />
WGS84 Projection
{t("WGS84 Projection")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.IC_ERROR} className="h-5 w-5 lg:h-6 lg:w-6" />
Earth Location
{t("Earth Location")}
</Text>
<Text variant="text-14-light" className="flex items-center gap-2">
<Icon name={IconNames.IC_ERROR} className="h-5 w-5 lg:h-6 lg:w-6" />
Country
{t("Country")}
</Text>
</div>
</div>
Expand Down
35 changes: 19 additions & 16 deletions src/components/elements/MapPolygonPanel/MapPolygonPanelItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useT } from "@transifex/react";
import classNames from "classnames";
import { DetailedHTMLProps, Dispatch, HTMLAttributes, SetStateAction } from "react";

Expand Down Expand Up @@ -32,35 +33,37 @@ const MapPolygonPanelItem = ({
...props
}: MapPolygonPanelItemProps) => {
const { openModal, closeModal } = useModalContext();
const t = useT();

const openFormModalHandlerRequestPolygonSupport = () => {
openModal(
<ModalWithMap
title="Request Support"
title={t("Request Support")}
onClose={closeModal}
content="Faja Lobi Project&nbsp;&nbsp;•&nbsp;&nbsp;Priceless Planet Coalition"
primaryButtonText="Submit"
content="-&nbsp;&nbsp;•&nbsp;&nbsp;-"
primaryButtonText={t("Submit")}
primaryButtonProps={{ className: "px-8 py-3", variant: "primary", onClick: closeModal }}
></ModalWithMap>
);
};
const openFormModalHandlerAddCommentary = () => {
openModal(
<ModalWithLogo
title="Blue Forest"
title={t("Blue Forest")}
onClose={closeModal}
status={StatusEnum.UNDER_REVIEW}
toogleButton
content="Faja Lobi Project&nbsp;&nbsp;•&nbsp;&nbsp;Priceless Planet Coalition"
primaryButtonText="Close"
content="-&nbsp;&nbsp;•&nbsp;&nbsp;-"
primaryButtonText={t("Close")}
primaryButtonProps={{ className: "px-8 py-3", variant: "primary", onClick: closeModal }}
/>
);
};
const openFormModalHandlerConfirm = () => {
openModal(
<ModalConfirm
title={"Confirm Polygon Deletion"}
content="Do you want to delete this polygon?"
title={t("Confirm Polygon Deletion")}
content={t("Do you want to delete this polygon?")}
onClose={closeModal}
onConfirm={() => {}}
/>
Expand All @@ -73,7 +76,7 @@ const MapPolygonPanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.IC_SITE_VIEW} className="h-4 w-4 lg:h-5 lg:w-5" />
&nbsp; Edit Polygon
&nbsp; {t("Edit Polygon")}
</Text>
),
onClick: () => {
Expand All @@ -87,7 +90,7 @@ const MapPolygonPanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.SEARCH} className="h-4 w-4 lg:h-5 lg:w-5" />
&nbsp; Zoom to
&nbsp; {t("Zoom to")}
</Text>
)
},
Expand All @@ -96,7 +99,7 @@ const MapPolygonPanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.DOWNLOAD_PA} className="h-5 w-5 lg:h-6 lg:w-6" />
&nbsp; Download
&nbsp; {t("Download")}
</Text>
)
},
Expand All @@ -106,7 +109,7 @@ const MapPolygonPanelItem = ({
<Button variant="text" onClick={openFormModalHandlerAddCommentary}>
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.COMMENT} className="h-5 w-5 lg:h-6 lg:w-6 " />
&nbsp; Comment
&nbsp; {t("Comment")}
</Text>
</Button>
)
Expand All @@ -117,7 +120,7 @@ const MapPolygonPanelItem = ({
<Button variant="text" onClick={openFormModalHandlerRequestPolygonSupport}>
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.REQUEST} className="h-5 w-5 lg:h-6 lg:w-6 " />
&nbsp; Request Support
&nbsp; {t("Request Support")}
</Text>
</Button>
)
Expand All @@ -128,7 +131,7 @@ const MapPolygonPanelItem = ({
<Button variant="text" onClick={openFormModalHandlerConfirm}>
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.TRASH_PA} className="h-5 w-5 lg:h-6 lg:w-6 " />
&nbsp; Delete Polygon
&nbsp; {t("Delete Polygon")}
</Text>
</Button>
)
Expand All @@ -148,9 +151,9 @@ const MapPolygonPanelItem = ({
<Icon name={IconNames.MAP_THUMBNAIL} className="h-11 w-11 rounded-lg bg-neutral-300" />
<div className="flex flex-1 flex-col">
<Text variant="text-14-bold" className="">
{title}
{t(title)}
</Text>
<Text variant="text-14-light">{subtitle}</Text>
<Text variant="text-14-light">{t(subtitle)}</Text>
</div>
<div className="lex h-full self-start">
<Menu container={refContainer?.current} placement={MENU_PLACEMENT_RIGHT_BOTTOM} menu={itemsPrimaryMenu}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ const MapPlygonSitePanel = ({

return (
<>
<FilterSearchBox placeholder={"Search"} className="mb-4 w-full" onChange={() => {}} />
<FilterSearchBox placeholder={t("Search")} className="mb-4 w-full" onChange={() => {}} />
<div className="mb-3 flex items-start justify-between rounded-tl-lg">
<Text variant="text-14-bold" className="flex items-center uppercase text-white">
<Icon name={IconNames.PLUS_PA} className="h-4 w-4" />
&nbsp; new Polygon
&nbsp; {t("new Polygon")}
</Text>
<div className="flex items-center gap-2">
<div className="relative" ref={menuRef}>
Expand Down Expand Up @@ -147,7 +147,7 @@ const MapPlygonSitePanel = ({
<div className="h-[calc(100%-159px)] rounded-bl-lg">
{PolygonData.length === 0 && (
<Text variant="text-16-light" className="mt-8 text-white">
{emptyText || t("No result")}
{emptyText ?? t("No result")}
</Text>
)}
<div
Expand Down
Loading