From 1b259661ff366cad87fe306eaebd7627430ff86b Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Fri, 21 Jun 2024 10:49:08 +0545 Subject: [PATCH 1/3] fix(mapLegends): map legend cleanup --- src/frontend/src/components/MapLegends.jsx | 29 ++-------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/frontend/src/components/MapLegends.jsx b/src/frontend/src/components/MapLegends.jsx index c46b9cce2f..c8a3286ac0 100755 --- a/src/frontend/src/components/MapLegends.jsx +++ b/src/frontend/src/components/MapLegends.jsx @@ -2,7 +2,7 @@ import React from 'react'; import CoreModules from '@/shared/CoreModules'; import AssetModules from '@/shared/AssetModules'; -const MapLegends = ({ direction, spacing, iconBtnProps, defaultTheme, valueStatus }) => { +const MapLegends = ({ iconBtnProps, defaultTheme }) => { const MapDetails = [ { value: 'Ready', @@ -29,11 +29,6 @@ const MapLegends = ({ direction, spacing, iconBtnProps, defaultTheme, valueStatu color: defaultTheme.palette.mapFeatureColors.validated, status: 'none', }, - // { - // value: 'Bad', - // color: defaultTheme.palette.mapFeatureColors.bad, - // status: 'none', - // }, { value: 'More mapping needed', color: defaultTheme.palette.mapFeatureColors.invalidated, @@ -67,28 +62,8 @@ const MapLegends = ({ direction, spacing, iconBtnProps, defaultTheme, valueStatu ); }; + return ( - // - // {MapDetails.map((data, index) => { - // return ( - // - // - // - // - // {valueStatus && ( - // - // {data.value} - // - // )} - // - // ); - // })} - //
{MapDetails.map((data, index) => { From d0e68276079b42de4e558604d4207020a49b78e1 Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Fri, 21 Jun 2024 10:49:36 +0545 Subject: [PATCH 2/3] fix(accordion): remove ref prop --- src/frontend/src/components/common/Accordion.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/components/common/Accordion.tsx b/src/frontend/src/components/common/Accordion.tsx index 5c1e48a21a..6fd0c17519 100644 --- a/src/frontend/src/components/common/Accordion.tsx +++ b/src/frontend/src/components/common/Accordion.tsx @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; import AssetModules from '@/shared/AssetModules'; interface IAccordion { + ref?: string | null; collapsed?: boolean; header: any; body: any; @@ -12,6 +13,7 @@ interface IAccordion { } export default function Accordion({ + ref = null, collapsed: isCollapsed, header, body, @@ -27,7 +29,7 @@ export default function Accordion({ }, [isCollapsed]); return ( -
+
Date: Fri, 21 Jun 2024 10:50:36 +0545 Subject: [PATCH 3/3] fix(projectDetailsV2): add handle click outside on map legend --- src/frontend/src/views/ProjectDetailsV2.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/views/ProjectDetailsV2.tsx b/src/frontend/src/views/ProjectDetailsV2.tsx index 61faa377ab..c2562a586d 100644 --- a/src/frontend/src/views/ProjectDetailsV2.tsx +++ b/src/frontend/src/views/ProjectDetailsV2.tsx @@ -49,6 +49,7 @@ const ProjectDetailsV2 = () => { const navigate = useNavigate(); const { windowSize } = WindowDimension(); const [divRef, toggle, handleToggle] = useOutsideClick(); + const [legendRef, legendToggle, handleLegendToggle] = useOutsideClick(); const [mainView, setView] = useState(); const [selectedTaskArea, setSelectedTaskArea] = useState(); @@ -512,6 +513,7 @@ const ProjectDetailsV2 = () => { />
} header={
@@ -519,9 +521,11 @@ const ProjectDetailsV2 = () => {

Legend

} - onToggle={() => {}} + onToggle={() => { + handleLegendToggle(); + }} className="fmtm-py-0 !fmtm-pb-0 fmtm-rounded-lg hover:fmtm-bg-gray-50" - collapsed={true} + collapsed={!legendToggle} />