Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report extension mapstore change map info utils #2

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MapStore2
6 changes: 3 additions & 3 deletions js/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ const appConfig = require('@mapstore/product/appConfig').default;
const plugins = require('@mapstore/product/plugins').default;

// Import plugin directly in application. Comment the 3 lines below to test the extension live.
const extensions = require('./extensions').default;
plugins.plugins = { ...plugins.plugins, ...extensions };
ConfigUtils.setConfigProp('translationsPath', ['./MapStore2/web/client/translations', './assets/translations']);
// const extensions = require('./extensions').default;
// plugins.plugins = { ...plugins.plugins, ...extensions };
// ConfigUtils.setConfigProp('translationsPath', ['./MapStore2/web/client/translations', './assets/translations']);
// end of lines to comment
checkForMissingPlugins(plugins.plugins);

Expand Down
Empty file.
4 changes: 2 additions & 2 deletions js/extension/plugins/Extension.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { currentFeatureSelector } from '@mapstore/selectors/mapInfo';
import '../assets/style.css';


export const extensionComponent = connect(state => ({
export const ReportIdentifyViewer = connect(state => ({
schemas: state.reportExtension && state.reportExtension.schemas,
display: state.reportExtension && state.reportExtension.display,
schemasByLayers: schemasByLayersSelector(state),
Expand All @@ -28,7 +28,7 @@ export const extensionComponent = connect(state => ({

export default {
name,
component: extensionComponent,
component: ReportIdentifyViewer,
reducers: {reportExtension},
epics: {
fetchSchemasEpic,
Expand Down
4 changes: 2 additions & 2 deletions js/extension/state/epics.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { loadedSchemas /* ,loadError */ } from "./actions";
import { layersSelector } from 'mapstore2/web/client/selectors/layers';
import * as MapInfoUtils from 'mapstore2/web/client/utils/MapInfoUtils';
import { extensionComponent } from '../plugins/Extension.jsx';
import { ReportIdentifyViewer } from '../plugins/Extension.jsx';
import { updateNode } from 'mapstore2/web/client/actions/layers';
import { updateFeatureInfoClickPoint } from "@mapstore/actions/mapInfo";
import Rx from "rxjs";
Expand All @@ -13,7 +13,7 @@ import '../assets/style.css';

export const fetchSchemasEpic = (action$) => action$.ofType('FETCH_SCHEMAS').switchMap(() => {
// set custom viewer to inject extension component into Identify
MapInfoUtils.setViewer('reportViewer', extensionComponent);
MapInfoUtils.setViewer('reportViewer', ReportIdentifyViewer);

// TODO: remove mocks and use API response
return Rx.Observable.of(loadedSchemas(mockSchemas));
Expand Down