Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #180 from bartvde/sdk-1.x-upgrade
Browse files Browse the repository at this point in the history
Upgrade to SDK 1.x
  • Loading branch information
bartvde authored Oct 12, 2017
2 parents 63d6266 + fd6d620 commit 5b3bedf
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 31 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"node": ">6"
},
"dependencies": {
"boundless-sdk": "0.10.24",
"@boundlessgeo/sdk": "1.0.4",
"core-js": "^2.4.1",
"intl": "^1.2.5",
"material-ui": "0.16.4",
"ol3-cesium": "3.9.4",
"openlayers": "4.0.1",
"openlayers": "4.2.0",
"react": "15.3.2",
"react-dom": "15.3.2",
"react-intl": "^2.1.5",
Expand All @@ -67,7 +67,7 @@
"chai-as-promised": "^6.0.0",
"codeclimate-test-reporter": "^0.4.0",
"css-loader": "^0.26.0",
"enzyme": "^2.7.0",
"enzyme": "2.8.0",
"eslint": "^3.7.1",
"eslint-plugin-react": "^6.4.1",
"exports-loader": "^0.6.3",
Expand Down
30 changes: 14 additions & 16 deletions src/components/geonode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import ol from 'openlayers';
import {addLocaleData, IntlProvider} from 'react-intl';
global.IntlProvider = IntlProvider;
import injectTapEventPlugin from 'react-tap-event-plugin';
import Globe from 'boundless-sdk/components/Globe';
import QGISPrint from 'boundless-sdk/components/QGISPrint';
import Zoom from 'boundless-sdk/components/Zoom';
import Rotate from 'boundless-sdk/components/Rotate';
import HomeButton from 'boundless-sdk/components/HomeButton';
import MapPanel from 'boundless-sdk/components/MapPanel';
import Globe from '@boundlessgeo/sdk/components/Globe';
import QGISPrint from '@boundlessgeo/sdk/components/QGISPrint';
import Zoom from '@boundlessgeo/sdk/components/Zoom';
import Rotate from '@boundlessgeo/sdk/components/Rotate';
import HomeButton from '@boundlessgeo/sdk/components/HomeButton';
import MapPanel from '@boundlessgeo/sdk/components/MapPanel';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import Snackbar from 'material-ui/Snackbar';
import LayerList from 'boundless-sdk/components/LayerList';
import LayerList from '@boundlessgeo/sdk/components/LayerList';
import enLocaleData from 'react-intl/locale-data/en.js';
import InfoPopup from 'boundless-sdk/components/InfoPopup';
import MapConfigTransformService from 'boundless-sdk/services/MapConfigTransformService';
import MapConfigService from 'boundless-sdk/services/MapConfigService';
import WMSService from 'boundless-sdk/services/WMSService';
import enMessages from 'boundless-sdk/locale/en.js';
import InfoPopup from '@boundlessgeo/sdk/components/InfoPopup';
import MapConfigTransformService from '@boundlessgeo/sdk/services/MapConfigTransformService';
import MapConfigService from '@boundlessgeo/sdk/services/MapConfigService';
import WMSService from '@boundlessgeo/sdk/services/WMSService';
import enMessages from '@boundlessgeo/sdk/locale/en.js';
enMessages["loginmodal.helptext"] = "Login to GeoNode";
global.enMessages = enMessages;

Expand All @@ -31,7 +31,7 @@ import {getLocalGeoServer,createThumbnail} from '../services/geonode';
import {getCRSFToken} from '../helper';

import '../css/app.css'
import 'boundless-sdk/dist/css/components.css';
import '@boundlessgeo/sdk/dist/css/components.css';

// Needed for onTouchTap
// Can go away when react 1.0 release
Expand Down Expand Up @@ -165,9 +165,7 @@ class GeoNodeViewer extends React.Component {
<div id='globe-button'><Globe tooltipPosition='right' map={map}/></div>
<div id='print-button'><QGISPrint menu={false} map={map} layouts={this.props.printLayouts}/></div>
<div id='home-button'><HomeButton extent={this._extent} tooltipPosition='right' map={map}/></div>
<div><LayerList showZoomTo={true} addBaseMap={{
tileServices: this.state.tileServices
}} addLayer={layerList} showTable={true} allowReordering={true} includeLegend={true} allowRemove={this.edit} tooltipPosition='left' allowStyling={this.edit || this.props.zoomToLayer} map={map}/></div>
<div id='layerlist'><LayerList showZoomTo={true} addBaseMap={true} baseMapTileServices={this.state.tileServices} addLayer={layerList} showTable={true} allowReordering={true} includeLegend={true} allowRemove={this.edit} tooltipPosition='left' allowStyling={this.edit || this.props.zoomToLayer} map={map}/></div>
<div id='zoom-buttons'><Zoom tooltipPosition='right' map={map}/></div>
<div id='rotate-button'><Rotate autoHide={true} tooltipPosition='right' map={map}/></div>
<div id='popup' className='ol-popup'><InfoPopup toggleGroup='navigation' toolId='nav' infoFormat='application/vnd.ogc.gml' map={map}/></div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/save.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ol from 'openlayers';
import Button from 'boundless-sdk/components/Button';
import Button from '@boundlessgeo/sdk/components/Button';
import classNames from 'classnames';
import SaveIcon from 'material-ui/svg-icons/content/save';
import {defineMessages, injectIntl, intlShape} from 'react-intl';
Expand Down
2 changes: 1 addition & 1 deletion src/components/saveContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {saveMap, setMapId, ajaxLogin} from '../state/map/actions';
import * as selectors from '../state/map/selectors';
import * as mapConfigSelectors from '../state/mapConfig/selectors';
import {connectAdvanced} from 'react-redux';
import LoginModal from 'boundless-sdk/components/LoginModal';
import LoginModal from '@boundlessgeo/sdk/components/LoginModal';

import SaveView from './saveView';

Expand Down
2 changes: 1 addition & 1 deletion src/composer.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import GeonodeComposer from './components/geonodeLink';
import enMessages from 'boundless-sdk/locale/en.js';
import enMessages from '@boundlessgeo/sdk/locale/en.js';
import {IntlProvider} from 'react-intl';
import {Provider} from 'react-redux';
import configureStore from './configureStore';
Expand Down
14 changes: 12 additions & 2 deletions src/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,18 @@ html, body {
position: absolute;
top: 20px;
}
.layer-list {
top: 74px !important;
#layerlist {
position: absolute;
right: 0px;
top: 20px;
}
.layer-tree-panel {
margin-right: 70px;
}
.layerlistbutton {
position: absolute !important;
right: 20px;
top: 0px;
}
#rotate-button {
top: 366px;
Expand Down
4 changes: 2 additions & 2 deletions src/services/geonode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MapConfigTransformService from 'boundless-sdk/services/MapConfigTransformService';
import MapConfigService from 'boundless-sdk/services/MapConfigService';
import MapConfigTransformService from '@boundlessgeo/sdk/services/MapConfigTransformService';
import MapConfigService from '@boundlessgeo/sdk/services/MapConfigService';
import {
getCRSFToken,
removeTrailingSlash
Expand Down
2 changes: 1 addition & 1 deletion src/viewer.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import GeoNodeViewer from './components/geonode';
import enMessages from 'boundless-sdk/locale/en.js';
import enMessages from '@boundlessgeo/sdk/locale/en.js';
import {IntlProvider} from 'react-intl';

class Viewer {
Expand Down
8 changes: 4 additions & 4 deletions tests/components/geonodeviewer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ol from 'openlayers';
import ReactTestUtils from 'react-addons-test-utils';
import {shallowWithIntl} from '../testhelper';

import LayerList from 'boundless-sdk/components/LayerList';
import LayerList from '@boundlessgeo/sdk/components/LayerList';

import GeoNodeViewer from '../../src/components/geonode';
import rendererWithIntl from '../../helper/renderWithIntl.js';
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('GeoNodeViewer', () => {
});
it('the layer list includes layers name', () => {
const geonodeviewer = ReactTestUtils.renderIntoDocument(<IntlProvider locale="en"><GeoNodeViewer config={config}/></IntlProvider>);
var contents = ReactTestUtils.scryRenderedDOMComponentsWithClass(geonodeviewer, 'layer-list-item');
var contents = ReactTestUtils.scryRenderedDOMComponentsWithClass(geonodeviewer, 'layer-list-name');
assert.equal(contents[0].textContent,'Sprint_85');
});
describe('two layers', () => {
Expand Down Expand Up @@ -87,7 +87,7 @@ describe('GeoNodeViewer', () => {
describe('viewer (default)', () => {
it('the layer list includes layers name', () => {
const geonodeviewer = ReactTestUtils.renderIntoDocument(<IntlProvider locale="en"><GeoNodeViewer config={config}/></IntlProvider>);
var contents = ReactTestUtils.scryRenderedDOMComponentsWithClass(geonodeviewer, 'layer-list-item');
var contents = ReactTestUtils.scryRenderedDOMComponentsWithClass(geonodeviewer, 'layer-list-name');
assert.equal(contents[0].textContent,'Sprint_85');
});
});
Expand All @@ -98,7 +98,7 @@ describe('GeoNodeViewer', () => {
});
it('can add layers', () => {
const geonodeviewer = ReactTestUtils.renderIntoDocument(<IntlProvider locale="en"><GeoNodeViewer mode='composer' config={config}/></IntlProvider>);
var contents = ReactTestUtils.scryRenderedDOMComponentsWithClass(geonodeviewer, 'layer-list-add');
var contents = ReactTestUtils.scryRenderedDOMComponentsWithClass(geonodeviewer, 'ms-ogc-web-services');
assert.equal(contents.length, 1);
});
it('does allow styling of layers', () => {
Expand Down

0 comments on commit 5b3bedf

Please sign in to comment.