Fix an issue where query tool hangs for some time when multiple columns are selected to open geometry viewer. #5044

This commit is contained in:
Aditya Toshniwal
2023-04-27 11:58:50 +05:30
committed by GitHub
parent 35cbe968f4
commit 46a9d4a69d
3 changed files with 14 additions and 12 deletions

View File

@@ -4,6 +4,7 @@
background-color: $color-bg !important;
display: inline-block;
color: $tree-text-fg !important;
position: relative;
&,
& * {

View File

@@ -208,10 +208,10 @@ function PopupTable({data}) {
}
PopupTable.propTypes = {
data: PropTypes.arrayOf({
data: PropTypes.arrayOf(PropTypes.shape({
column: PropTypes.string,
value: PropTypes.string,
}),
value: PropTypes.any,
})),
};
function GeoJsonLayer({data}) {
@@ -250,13 +250,14 @@ function GeoJsonLayer({data}) {
style={{weight: 2}}
onEachFeature={(feature, layer)=>{
if(_.isFunction(data.getPopupContent)) {
const popupContentNode = (
<Theme>
<PopupTable data={data.getPopupContent(layer.feature.geometry)}/>
</Theme>
);
const popupContentHtml = ReactDOMServer.renderToString(popupContentNode);
layer.bindPopup(popupContentHtml, {
layer.bindPopup((l)=>{
const popupContentNode = (
<Theme>
<PopupTable data={data.getPopupContent(l.feature.geometry)}/>
</Theme>
);
return ReactDOMServer.renderToString(popupContentNode);
}, {
closeButton: false,
minWidth: 260,
maxWidth: 300,

View File

@@ -1253,7 +1253,7 @@ export function ResultSet() {
} else if(selectedRange.current) {
let [,, startRowIdx, endRowIdx] = getRangeIndexes();
selRowsData = rows.slice(startRowIdx, endRowIdx+1);
} else if(selectedCell.current[0]) {
} else if(selectedCell.current?.[0]) {
selRowsData = [selectedCell.current[0]];
}
LayoutHelper.openTab(queryToolCtx.docker, {