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

Feature/intervention #2343

Merged
merged 55 commits into from
Jan 16, 2025
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
23261b4
Intervention Constant added
shyambhongle Dec 10, 2024
140cb0d
Basic intervention filter added
shyambhongle Dec 10, 2024
a3e6a30
Project Context updated
shyambhongle Dec 10, 2024
067d46d
Intervention polygon color logic added
shyambhongle Dec 10, 2024
3afbe9e
Intervetion filter updated
shyambhongle Dec 10, 2024
3e17a09
default filter added
shyambhongle Dec 10, 2024
d861be7
'All' added in intervention filter
shyambhongle Dec 10, 2024
b4f31fc
minor:Content Updated
shyambhongle Dec 11, 2024
411c121
Intervention webapp fixes
shyambhongle Dec 26, 2024
2d6de25
plantinfo mobileview reverted
shyambhongle Dec 26, 2024
8b9ccf9
Mobile view slider fix
shyambhongle Dec 26, 2024
1659928
minor
shyambhongle Dec 26, 2024
282b8e4
minor UI fixes
shyambhongle Dec 27, 2024
96a027b
mutlitree polygon color updated
shyambhongle Dec 27, 2024
43d3856
code refactor
shyambhongle Dec 27, 2024
9f9021c
unused code refactored
shyambhongle Dec 27, 2024
8bfe467
zoom out when intervention selecte
shyambhongle Dec 30, 2024
7829842
Filter container height fixed
shyambhongle Dec 30, 2024
b3cfe1b
UI fixes
shyambhongle Dec 30, 2024
9c4e9b5
highlight selected intervention
shyambhongle Dec 30, 2024
bcabeb4
toggle menu feature added
shyambhongle Dec 30, 2024
578a4c2
All Intervention set to default
shyambhongle Dec 30, 2024
9a88fe8
minor fix
shyambhongle Dec 30, 2024
2d82886
padding added inbetween overlapping intervention header
shyambhongle Dec 30, 2024
57d4527
minor clipath refactor
shyambhongle Dec 30, 2024
59b6165
Merge branch 'develop' into feature/intervention
shyambhongle Jan 3, 2025
0b86b1f
code changes
shyambhongle Jan 3, 2025
588bfc2
minor
shyambhongle Jan 3, 2025
171adf8
HID added
shyambhongle Jan 5, 2025
b22fc3a
enrichement planting changes
shyambhongle Jan 5, 2025
a7555c3
minor
shyambhongle Jan 5, 2025
4c6de8d
minor
shyambhongle Jan 6, 2025
1ac22f6
type added in imports
shyambhongle Jan 8, 2025
6ea3699
minor css issue fix
shyambhongle Jan 8, 2025
7c1e9e9
empty slide due tio metadata fix
shyambhongle Jan 8, 2025
6bf4248
removed unwanted code and renamed variables
shyambhongle Jan 8, 2025
548994b
code refactor
shyambhongle Jan 8, 2025
555e3ec
intervention type error fix
shyambhongle Jan 8, 2025
d7dc806
code refactor
shyambhongle Jan 8, 2025
36de55d
condition refactorred
shyambhongle Jan 9, 2025
72797b1
code refactor
shyambhongle Jan 13, 2025
98c4379
refactor: extract createCardData fn outside component
mohitb35 Jan 13, 2025
0225fc9
minor
shyambhongle Jan 13, 2025
6aa75f4
Rename OtherInterventionMetaData.tsx to OtherInterventionMetadata.tsx
shyambhongle Jan 13, 2025
b84ea21
fix: removes extra comma visible below OtherInterventionMetadata
mohitb35 Jan 13, 2025
364dae1
refactor: uses type imports & removes unused imports
mohitb35 Jan 13, 2025
b80d951
refactor: use type imports and improve code formatting in interventio…
mohitb35 Jan 13, 2025
78492b4
refactor: defines more specific types for selectedInterventionType
mohitb35 Jan 13, 2025
9f802c2
feat: add geometry property to OtherInterventions interface
mohitb35 Jan 14, 2025
c1d748f
refactor: code formatting changes per prettier rules
mohitb35 Jan 14, 2025
10096f6
date component placement changes
shyambhongle Jan 15, 2025
b51cf14
Date UI fix
shyambhongle Jan 15, 2025
a35837b
hover issue fix
shyambhongle Jan 15, 2025
01c9cfd
dynamic string added for localization
shyambhongle Jan 15, 2025
9214c2b
Code refactor
shyambhongle Jan 15, 2025
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
Prev Previous commit
Next Next commit
highlight selected intervention
shyambhongle committed Dec 30, 2024
commit 9c4e9b5ee4d4246b34a0dd6dc3d30ca69c1fe9d3
Original file line number Diff line number Diff line change
@@ -8,33 +8,34 @@ type InterventionData = {
index: number
};
interface InterventionListProps {
siteList: InterventionData[];
setSelectedSite: SetState<string>;
interventionList: InterventionData[];
setSelectedIntervention: SetState<string>;
setIsMenuOpen: SetState<boolean>;
selectedSiteData: InterventionData | undefined;
selectedIntervention: string
}
const InterventionList = ({
siteList,
setSelectedSite,
interventionList,
setSelectedIntervention,
setIsMenuOpen,
selectedSiteData,
}: InterventionListProps) => {
const handleSiteSelection = (index: number, key: string) => {
setIsMenuOpen(false);
setSelectedSite(key);
setSelectedIntervention(key);
};

return (
<ul className={styles.siteListOptions}>
{siteList.map((site, index) => {
{interventionList.map((intervention, index) => {
return (
<li
className={`${styles.listItem} ${site.index === selectedSiteData?.index ? styles.selectedItem : ''
className={`${styles.listItem} ${intervention.value === selectedSiteData?.value ? styles.selectedItem : ''
}`}
onClick={() => handleSiteSelection(index, site.value)}
onClick={() => handleSiteSelection(index, intervention.value)}
key={index}
>
<p>{site.label}</p>
<p>{intervention.label}</p>
</li>
);
})}
19 changes: 10 additions & 9 deletions src/features/projectsV2/ProjectsMap/InterventionDropDown/index.tsx
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ const InterventionDropdown = ({
isMobile
}: Props) => {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const siteList = useMemo(() => {
const interventionList = useMemo(() => {
if (!allIntervention) return [];
return allIntervention.map((el) => ({
label: el.label,
@@ -48,15 +48,15 @@ const InterventionDropdown = ({
<>
<div className={styles.dropdownButton} onClick={toggleMenu}>
<div className={styles.siteIconAndTextContainer} >
<InterventionIcon width={27} color={'#333'} />
<InterventionIcon />
<>
{selectedSiteData && (
<div className={styles.labelTextContainer}>
{isMobile?<label className={styles.sitesLabel}>{truncateString(selectedSiteData?.label, 40)}
</label>:
<p className={styles.siteName} style={{marginTop:'5px'}}>
{truncateString(selectedSiteData?.label, 40)}
</p>}
{isMobile ? <label className={styles.sitesLabel}>{truncateString(selectedSiteData?.label, 40)}
</label> :
<p className={styles.siteName} style={{ marginTop: '5px' }}>
{truncateString(selectedSiteData?.label, 40)}
</p>}
</div>
)}
</>
@@ -71,10 +71,11 @@ const InterventionDropdown = ({
</div>
{isMenuOpen && (
<InterventionList
siteList={siteList}
setSelectedSite={setSelectedIntervention}
interventionList={interventionList}
setSelectedIntervention={setSelectedIntervention}
setIsMenuOpen={setIsMenuOpen}
selectedSiteData={selectedSiteData}
selectedIntervention={selectedIntervention}
/>
)}
</>