Skip to content

Commit

Permalink
Fix loading embedded tabular collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ridoo committed Aug 14, 2024
1 parent ed29562 commit b8efee4
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ import { Tabs, Tab } from 'react-bootstrap';
import { createPlugin } from '@mapstore/framework/utils/PluginsUtils';

import resourceReducer from '@js/reducers/gnresource';
import { layersSelector } from '@mapstore/framework/selectors/layers';
import { TableComponent } from './TabularPreview';

function propertyToKey(property, index) {
return `${property}`;
};

function TabbedTablesComponent({ owsUrl, tableLayers }) {
const [tabs, setTabs] = useState([])
const [key, setKey] = useState(0);
Expand Down Expand Up @@ -55,11 +50,11 @@ TabbedTablesComponent.propTypes = {

const TabularCollectionViewerPlugin = connect(
createSelector([
layersSelector,
state => state?.gnresource?.data || null,
(state) => state?.gnsettings?.geoserverUrl,
], (layers, geoserverUrl, map) => {
], (resource, geoserverUrl) => {
const owsUrl = `${geoserverUrl}ows`
const tableLayers = layers.filter(l => l.group !== "background")
const tableLayers = resource.maplayers || []
return { owsUrl, tableLayers };
})
)(TabbedTablesComponent);
Expand Down

0 comments on commit b8efee4

Please # to comment.