Skip to content

Commit

Permalink
feat(records panel): completes the records panel migration to odoo 17
Browse files Browse the repository at this point in the history
  • Loading branch information
sersanchus committed May 20, 2024
1 parent 1d6a286 commit 6133899
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ export class GeoengineRenderer extends Component {
*/
onDisplayPopupRecord(record) {
const popup = this.getPopup();
const feature = this.vectorSource.getFeatureById(record.id);
const feature = this.vectorSource.getFeatureById(record.resId);
if (feature) {
this.mountGeoengineRecord({
popup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<div class="map_container">
<div id="olmap" />
</div>
<!-- <RecordsPanel
<RecordsPanel
list="props.data"
onDisplayPopupRecord.bind="onDisplayPopupRecord"
zoomOnFeature.bind="zoomOnFeature"
zoomOutOnFeature.bind="getOriginalZoom"
/> -->
/>
</div>
<div id="popup" class="ol-popup">
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class RecordsPanel extends Component {
*/
onDisplayPopupRecord(record) {
const rec = this.props.list.records.find((val) => val.id === record.id);
this.state.isClicked = record.id;
this.state.isClicked = record.resId;
this.props.onDisplayPopupRecord(rec);
}

Expand Down Expand Up @@ -76,4 +76,10 @@ export class RecordsPanel extends Component {
}

RecordsPanel.template = "base_geoengine.RecordsPanel";
RecordsPanel.props = {
list: {type: Object},
onDisplayPopupRecord: {type: Function},
zoomOnFeature: {type: Function},
zoomOutOnFeature: {type: Function},
};
RecordsPanel.components = {SearchBarRecords};
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ export class SearchBarRecords extends Component {
}

SearchBarRecords.template = "base_geoengine.SearchBarRecords";
SearchBarRecords.props = {
onInputKeyup: {type: Function},
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<templates>
<t t-name="base_geoengine.SearchBarRecords">
<div class="o_cp_searchview d-flex flex-grow-1" role="search">
<div class="o_cp_searchview d-flex input-group" role="search">
<div
class="o_searchview pb-1 align-self-center border-bottom flex-grow-1"
class="o_searchview form-control d-print-contents d-flex align-items-center py-1"
role="search"
>
<i
class="o_searchview_icon oi oi-search"
class="o_searchview_icon d-print-none oi oi-search me-2"
role="img"
aria-label="Search..."
title="Search..."
Expand All @@ -16,7 +16,7 @@
<input
t-ref="searchComponent"
type="text"
class="o_searchview_input"
class="o_searchview_input o_input d-print-none flex-grow-1 w-auto border-0"
placeholder="Search..."
t-on-keyup="onInputKeyup"
/>
Expand Down

0 comments on commit 6133899

Please sign in to comment.