From 3dae27e2fc379d0177a5fced68ce92c574f69ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Poincelet?= Date: Mon, 23 Dec 2024 14:09:00 +0100 Subject: [PATCH 01/15] Improve Parcelles tabs css --- js/extension/cadastrapp.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/extension/cadastrapp.css b/js/extension/cadastrapp.css index bf0be3c..db6e3d0 100644 --- a/js/extension/cadastrapp.css +++ b/js/extension/cadastrapp.css @@ -108,6 +108,17 @@ height: calc(50vh - 180px); min-height: 200px; } +.cadastrapp .not-scrolled-tab .nav { + display: flex; + flex-wrap: nowrap; +} +.cadastrapp .not-scrolled-tab .nav > li > a { + padding: 5px; +} +.cadastrapp .not-scrolled-tab .nav-tab { + justify-content: space-between; + width: 100%; +} /* reconsider this */ .item-row { width: 100%; From 9225a8adfe9531f916981937c5699d696d33d752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Poincelet?= Date: Thu, 26 Dec 2024 16:59:10 +0100 Subject: [PATCH 02/15] Modify Search Buttons and Search Plot disply --- js/extension/cadastrapp.css | 8 ++++---- js/extension/components/lists/ReferencesList.jsx | 2 +- js/extension/components/search/PlotSearch.jsx | 14 ++++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/js/extension/cadastrapp.css b/js/extension/cadastrapp.css index db6e3d0..8fe28fe 100644 --- a/js/extension/cadastrapp.css +++ b/js/extension/cadastrapp.css @@ -75,9 +75,10 @@ .cadastrapp .owners-search, .cadastrapp .coownership-search, .cadastrapp .plots-search { - padding: 10px; - max-height: 50%; - height: 50%; + margin: 10px; + max-height: 55%; + height: 55%; + border: solid 1px #ddd; } .cadastrapp .plots-selection { width: 100%; @@ -95,7 +96,6 @@ width: 100%; } .cadastrapp .tab-content { - border: solid 1px #ddd; border-top: none; overflow-x: hidden; overflow-y: auto; diff --git a/js/extension/components/lists/ReferencesList.jsx b/js/extension/components/lists/ReferencesList.jsx index 48d3daa..59a2e2e 100644 --- a/js/extension/components/lists/ReferencesList.jsx +++ b/js/extension/components/lists/ReferencesList.jsx @@ -38,7 +38,7 @@ export default function ReferencesList({ references = [], cgocommune, onAddRefer style={{ marginLeft: 6, marginTop: 4 }} className="pull-left"> -
+
{ sections && references.map((row, index) => { return ( {}, loading}) { setValue={(key, value) => setFormState(SEARCH_TYPES.LOT, key, value)} /> - resetFormState(currentTab)} - onSearch={() => onSearch(currentTab, searchState[currentTab])} - /> +
+ resetFormState(currentTab)} + onSearch={() => onSearch(currentTab, searchState[currentTab])} + /> +
); } From 89bc0c5ad9ba3a2d973a19f318a139a9a802b7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Poincelet?= Date: Mon, 30 Dec 2024 09:55:56 +0100 Subject: [PATCH 03/15] modif plots parcelles --- js/extension/cadastrapp.css | 11 +++++++++-- js/extension/components/PlotSelection.jsx | 17 ++++++++++++----- js/extension/components/search/PlotSearch.jsx | 3 ++- .../components/search/SearchButtons.jsx | 4 ++-- js/extension/reducers/cadastrapp.js | 2 ++ 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/js/extension/cadastrapp.css b/js/extension/cadastrapp.css index 8fe28fe..69b3681 100644 --- a/js/extension/cadastrapp.css +++ b/js/extension/cadastrapp.css @@ -76,10 +76,17 @@ .cadastrapp .coownership-search, .cadastrapp .plots-search { margin: 10px; - max-height: 55%; - height: 55%; border: solid 1px #ddd; } +.cadastrapp .plots-search .searchButtonsContainer { + display: flex; + align-items: center; +} +.searchButtons{ + float: none !important; + margin: 10px; + margin-left: auto; +} .cadastrapp .plots-selection { width: 100%; padding: 10px; diff --git a/js/extension/components/PlotSelection.jsx b/js/extension/components/PlotSelection.jsx index fce3be0..2e057d2 100644 --- a/js/extension/components/PlotSelection.jsx +++ b/js/extension/components/PlotSelection.jsx @@ -59,22 +59,20 @@ function PlotSelectionTabContent({ function PlotSelectionTabActionButtons({onNewTab = () => {}, onTabDelete = () => {}}) { return ( - + }> - }> + {/* }> } onClick={onTabDelete}> - + */} ); } @@ -84,6 +82,8 @@ function PlotTabs({ onTabChange, data, plots, + onTabDelete = () => {}, + onRowsSelected, ...props }) { @@ -102,6 +102,13 @@ function PlotTabs({ {plots.slice(0, plots.length > MAX_TABS ? MAX_TABS - 1 : MAX_TABS).map((plot, index) => ( {getPlotTitle(plot, index)} + }> + } + onClick={() => {onRowsSelected(); onTabDelete(index);}}> + + + ))} {plots.length > MAX_TABS diff --git a/js/extension/components/search/PlotSearch.jsx b/js/extension/components/search/PlotSearch.jsx index f618a3c..222c848 100644 --- a/js/extension/components/search/PlotSearch.jsx +++ b/js/extension/components/search/PlotSearch.jsx @@ -47,8 +47,9 @@ export default function PlotsSearch({onSearch = () => {}, loading}) { setValue={(key, value) => setFormState(SEARCH_TYPES.LOT, key, value)} /> -
+
resetFormState(currentTab)} diff --git a/js/extension/components/search/SearchButtons.jsx b/js/extension/components/search/SearchButtons.jsx index e1f83d8..32ca1b7 100644 --- a/js/extension/components/search/SearchButtons.jsx +++ b/js/extension/components/search/SearchButtons.jsx @@ -5,9 +5,9 @@ import { Button, ButtonGroup, Glyphicon } from "react-bootstrap"; export default function({ - loading, valid, onClear = () => {}, onSearch = () => {} + loading, valid, onClear = () => {}, onSearch = () => {}, className }) { - return ( + return ( {loading ? : null} - {/* }> - } - onClick={onTabDelete}> - - - */} ); } @@ -98,9 +91,9 @@ function PlotTabs({ defaultActiveKey={active}> -
- resetFormState(SEARCH_TYPES.COOWNER)} - onSearch={() => { - if (isString(searchState[SEARCH_TYPES.COOWNER]?.proprietaire) && !values?.parcelle) { - onOwnersSearch(SEARCH_TYPES.COOWNER, searchState[SEARCH_TYPES.COOWNER]); - } else { - // plot search - onSearch(SEARCH_TYPES.COOWNER, searchState[SEARCH_TYPES.COOWNER]); - } +
+ resetFormState(SEARCH_TYPES.COOWNER)} + onSearch={() => { + if (isString(searchState[SEARCH_TYPES.COOWNER]?.proprietaire) && !values?.parcelle) { + onOwnersSearch(SEARCH_TYPES.COOWNER, searchState[SEARCH_TYPES.COOWNER]); + } else { + // plot search + onSearch(SEARCH_TYPES.COOWNER, searchState[SEARCH_TYPES.COOWNER]); + } }}/> +
); } diff --git a/js/extension/components/search/OwnersSearch.jsx b/js/extension/components/search/OwnersSearch.jsx index a05428c..3b52515 100644 --- a/js/extension/components/search/OwnersSearch.jsx +++ b/js/extension/components/search/OwnersSearch.jsx @@ -41,13 +41,17 @@ export default function OwnersSearch({ loading, onOwnersSearch = () => {}}) { setValue={(key, value) => setFormState(SEARCH_TYPES.OWNER_LOT, key, value)} /> - resetFormState(currentTab)} - onSearch={() => { - onOwnersSearch(currentTab, searchState[currentTab]); +
+ resetFormState(currentTab)} + onSearch={() => { + onOwnersSearch(currentTab, searchState[currentTab]); }} /> +
+ ); } From 2c1804f01806d834e2a433506a082dfe53c0b0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Poincelet?= Date: Thu, 2 Jan 2025 14:49:11 +0100 Subject: [PATCH 06/15] fix index of removed plot --- js/extension/components/PlotSelection.jsx | 6 +++--- js/extension/plugins/cadastrapp/PlotSelection.jsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/extension/components/PlotSelection.jsx b/js/extension/components/PlotSelection.jsx index 2563516..917d648 100644 --- a/js/extension/components/PlotSelection.jsx +++ b/js/extension/components/PlotSelection.jsx @@ -75,7 +75,7 @@ function PlotTabs({ onTabChange, data, plots, - onTabDelete = () => {}, + onTabDelete = (index) => {index}, onRowsSelected, ...props }) { @@ -98,7 +98,7 @@ function PlotTabs({ }> } - onClick={() => {onRowsSelected(); onTabDelete(index);}}> + onClick={() => {onTabDelete(index);}}> @@ -112,7 +112,7 @@ function PlotTabs({ }> } - onClick={() => {onRowsSelected(); onTabDelete(index);}}> + onClick={() => {onTabDelete(index);}}> diff --git a/js/extension/plugins/cadastrapp/PlotSelection.jsx b/js/extension/plugins/cadastrapp/PlotSelection.jsx index f1567ce..c4e4d64 100644 --- a/js/extension/plugins/cadastrapp/PlotSelection.jsx +++ b/js/extension/plugins/cadastrapp/PlotSelection.jsx @@ -44,7 +44,7 @@ const PlotsSelection = connect((state) => ({ removePlots: removePlots, zoomToSelection: zoomToSelection, showLandedPropertyInformationByParcelle, - onTabDelete: () => removePlotSelection(), + onTabDelete: (index) => removePlotSelection(index), onSaveAsAnnotation: saveAsAnnotation })(PS); From 1d2ae50deb6517ecbd1bc70fc1fcd66d10ff1a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Poincelet?= Date: Thu, 2 Jan 2025 16:09:32 +0100 Subject: [PATCH 07/15] fix plot selection and fix delete when tabs > max tab --- js/extension/components/PlotSelection.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/extension/components/PlotSelection.jsx b/js/extension/components/PlotSelection.jsx index 917d648..9401137 100644 --- a/js/extension/components/PlotSelection.jsx +++ b/js/extension/components/PlotSelection.jsx @@ -76,7 +76,6 @@ function PlotTabs({ data, plots, onTabDelete = (index) => {index}, - onRowsSelected, ...props }) { @@ -93,10 +92,11 @@ function PlotTabs({