Skip to content

Commit

Permalink
Merge pull request georchestra#174 from landryb/fix/164+
Browse files Browse the repository at this point in the history
Properly prefix section name ccosec with ccopre field - fixes georchestra#164
  • Loading branch information
landryb authored Aug 22, 2022
2 parents f45ae66 + d4fce73 commit 98d5c1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions js/extension/components/lists/ReferenceRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ export default function ReferenceRow({
defaultOpen
disabled={isEmpty(sections)}
style={fieldStyle}
textField="ccosec"
textField="label"
placeholder={'cadastrapp.parcelle.result.ccosec'}
value={section}
onChange={() => { }}
onSelect={newSection => {
onSetValue('section', newSection);
}}
filter="contains"
data={sections.map(({ ccosec, ...rest}) => ({
data={sections.map(({ ccosec, ccopre, ...rest}) => ({
ccosec,
ccopre,
...rest,
label: "" + ccosec
label: ccopre + ccosec
}))}
/>
<DropdownList
Expand Down
6 changes: 3 additions & 3 deletions js/extension/components/table/PlotsSelectionTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const columns = [{
name: "cadastrapp.parcelle.result.commune",
resizable: true
}, {
key: "ccosec",
key: "sectionLabel",
width: 80,
sortable: true,
name: "cadastrapp.parcelle.result.ccosec",
Expand Down Expand Up @@ -45,8 +45,8 @@ function PlotsSelectionTable({
if (!data) {
return null;
}
// create mixed column for address
const processedRows = data.map(v => ({ ...v, cadastralAddr: v.dnvoiri + " " + v.cconvo + " " + v.dvoilib }));
// create mixed column for address and section
const processedRows = data.map(v => ({ ...v, sectionLabel: v.ccopre + v.ccosec, cadastralAddr: v.dnvoiri + " " + v.cconvo + " " + v.dvoilib }));
const rows = (({sortColumn, sortDirection} = {}) => {
if (sortDirection === "ASC") {
return sortBy(processedRows, sortColumn);
Expand Down

0 comments on commit 98d5c1e

Please sign in to comment.