diff --git a/web/client/components/widgets/enhancers/__tests__/tableWidget-test.jsx b/web/client/components/widgets/enhancers/__tests__/tableWidget-test.jsx index b5aa254f11..79aa266ef4 100644 --- a/web/client/components/widgets/enhancers/__tests__/tableWidget-test.jsx +++ b/web/client/components/widgets/enhancers/__tests__/tableWidget-test.jsx @@ -67,6 +67,23 @@ describe('widgets tableWidget enhancer', () => { const container = document.getElementById('container'); expect(container).toExist(); + }); + it('tableWidget with gridTools including zoom icon for dashboard viewer in case of just table is added [No maps added]', (done) => { + const Sink = tableWidget(createSink( props => { + expect(props).toExist(); + expect(props.gridTools.length).toEqual(0); + done(); + })); + ReactDOM.render( { + expect(path).toBe("dependencies.extentObj"); + expect(id).toBe("123456"); + expect(value).toEqual({ + bbox: [-10, 0, 0, -10] + }, {}, "", { crs: "EPSG:4326", maxZoom: null }); + }}/>, document.getElementById("container")); + const container = document.getElementById('container'); + expect(container).toExist(); + }); it('tableWidget with gridTools including zoom icon for dashboard viewer [not enable zoom in config]', (done) => { const Sink = tableWidget(createSink( props => { diff --git a/web/client/components/widgets/enhancers/tableWidget.js b/web/client/components/widgets/enhancers/tableWidget.js index 92f03a6852..4dc968c048 100644 --- a/web/client/components/widgets/enhancers/tableWidget.js +++ b/web/client/components/widgets/enhancers/tableWidget.js @@ -30,8 +30,8 @@ const withSorting = () => withPropsOnChange(["gridEvents"], ({ gridEvents = {}, */ export default compose( compose(connect(null, (dispatch, ownProps)=>{ - let isTblDashboard = ownProps?.enableZoomInTblWidget && ownProps?.mapSync && ownProps?.widgetType === 'table' && ownProps?.isDashboardOpened; - let isTblWidgetInMapViewer = ownProps?.widgetType && !isTblDashboard && ownProps?.enableZoomInTblWidget; + let isTblDashboard = ownProps?.enableZoomInTblWidget && ownProps?.widgetType === 'table' && ownProps?.isDashboardOpened; + let isTblWidgetInMapViewer = ownProps?.widgetType === 'table' && !isTblDashboard && ownProps?.enableZoomInTblWidget; let isTblSyncWithMap = ownProps?.mapSync; return { gridTools: (isTblSyncWithMap && isTblDashboard) || (isTblWidgetInMapViewer) ? gridTools.map((t) => ({