@corpsmap/corpsmap 3.2.41 → 3.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dev.js +310 -94
- package/lib/prod.js +310 -94
- package/package.json +1 -1
- package/src/core-plugins/change-log/change-log-modal.js +7 -5
- package/src/core-plugins/legend/bundle.js +1021 -1033
- package/src/core-plugins/resources/bundle.js +87 -0
- package/src/core-plugins/resources/index.js +15 -0
- package/src/core-plugins/resources/resources-button.js +44 -0
- package/src/core-plugins/resources/resources-modal.js +75 -0
- package/src/index.js +109 -107
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import ResourcesModal from './resources-modal';
|
|
2
|
+
|
|
3
|
+
const url = `${process.env.REACT_APP_FUDS_RESOURCES_URL}`;
|
|
4
|
+
const defaultHtml = [
|
|
5
|
+
{"name": "FUDSMIS Portal - Default", "url": "https://fudsportal.usace.army.mil/"},
|
|
6
|
+
{"name": "IPaC Information for Planning and Consultation - Default", "url": "https://ipac.ecosphere.fws.gov/"},
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'resources',
|
|
11
|
+
|
|
12
|
+
getReducer: () => {
|
|
13
|
+
const initialData = {
|
|
14
|
+
items: defaultHtml,
|
|
15
|
+
renderModal: false,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (state = initialData, { type, payload }) => {
|
|
19
|
+
switch (type) {
|
|
20
|
+
case "RESOURCES_LOAD_TEST_DATA":
|
|
21
|
+
case "RESOURCES_LOAD_PRODUCTION_DATA":
|
|
22
|
+
case "RESOURCES_MODAL_WINDOW_OPENED":
|
|
23
|
+
return Object.assign({}, state, payload);
|
|
24
|
+
default:
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
doGetResourceData: () => ({dispatch, store, anonGet}) => {
|
|
31
|
+
anonGet(url, (err, response, body) => {
|
|
32
|
+
if (err || response.statusCode !== 200) {
|
|
33
|
+
// On Error Load Test Data
|
|
34
|
+
dispatch({
|
|
35
|
+
type: "RESOURCES_LOAD_TEST_DATA",
|
|
36
|
+
payload: { items: defaultHtml, renderModal: true },
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
} else {
|
|
40
|
+
try {
|
|
41
|
+
|
|
42
|
+
console.log("Production Resource Data")
|
|
43
|
+
console.log(body)
|
|
44
|
+
let data = JSON.parse(body);
|
|
45
|
+
console.log('data')
|
|
46
|
+
console.log(data)
|
|
47
|
+
let items = data.items
|
|
48
|
+
console.log("ITEMS");
|
|
49
|
+
console.log(items)
|
|
50
|
+
dispatch({
|
|
51
|
+
type: "RESOURCES_LOAD_PRODUCTION_DATA",
|
|
52
|
+
payload: { items: items, renderModal: true },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
} catch (err) {
|
|
56
|
+
// alert(" ! ! ! ERROR IN CATCH BLOCK ! ! ! ")
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
doOpenModalResources: () => ({dispatch, store}) => {
|
|
63
|
+
store.doModalOpen({
|
|
64
|
+
children: [ ResourcesModal ],
|
|
65
|
+
options: {},
|
|
66
|
+
openedBy: 'ResourcesButton'
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
dispatch({
|
|
71
|
+
type: "RESOURCES_MODAL_WINDOW_OPENED",
|
|
72
|
+
payload: { renderModal: false },
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
selectResourceItems: (state) => {
|
|
78
|
+
return state.resources.items;
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
reactRenderResourceModal: (state) => {
|
|
82
|
+
if (state.resources.renderModal)
|
|
83
|
+
return { actionCreator: "doOpenModalResources" };
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import bundle from './bundle';
|
|
2
|
+
import resourcesButton from './resources-button';
|
|
3
|
+
|
|
4
|
+
const plugin = {
|
|
5
|
+
pluginName: 'resources',
|
|
6
|
+
enabled: true,
|
|
7
|
+
bundle: bundle,
|
|
8
|
+
components:[{
|
|
9
|
+
component: resourcesButton,
|
|
10
|
+
region: 'right-sidebar-top',
|
|
11
|
+
sortOrder: 130,
|
|
12
|
+
}],
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default plugin;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { connect } from 'redux-bundler-react';
|
|
3
|
+
import { SidebarButton } from '../../application-controls/index';
|
|
4
|
+
import ResourcesModal from './resources-modal'
|
|
5
|
+
|
|
6
|
+
class ResourcesButton extends React.Component {
|
|
7
|
+
constructor(props){
|
|
8
|
+
super(props);
|
|
9
|
+
this.handleClick = this.handleClick.bind(this);
|
|
10
|
+
this.openModalResources = this.openModalResources.bind(this);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
openModalResources() {
|
|
14
|
+
const { doModalOpen } = this.props;
|
|
15
|
+
doModalOpen( {
|
|
16
|
+
children: [ ResourcesModal ],
|
|
17
|
+
options: {},
|
|
18
|
+
openedBy: 'ResourcesButton'
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
handleClick(){
|
|
23
|
+
const { doGetResourceData } = this.props;
|
|
24
|
+
this.openModalResources();
|
|
25
|
+
doGetResourceData();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
render() {
|
|
29
|
+
return (
|
|
30
|
+
<SidebarButton
|
|
31
|
+
iconClass="mdi mdi-library"
|
|
32
|
+
label="Resources"
|
|
33
|
+
title="Resources"
|
|
34
|
+
onClick={ this.handleClick }
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default connect(
|
|
41
|
+
"doModalOpen",
|
|
42
|
+
"doGetResourceData",
|
|
43
|
+
ResourcesButton
|
|
44
|
+
);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "redux-bundler-react";
|
|
3
|
+
|
|
4
|
+
class ResourcesModal extends React.Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.state = {};
|
|
8
|
+
this.close = this.close.bind(this);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
close() {
|
|
12
|
+
const { doModalClose } = this.props;
|
|
13
|
+
doModalClose();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
render() {
|
|
17
|
+
const { theme, doGetResourceData, resourceItems} = this.props;
|
|
18
|
+
|
|
19
|
+
const arrayDataItems = resourceItems.map( data =>
|
|
20
|
+
<li style={Object.keys(data).length > 0 ? {listStyleType: "disc"}: {listStyleType: "none"} }>
|
|
21
|
+
|
|
22
|
+
{data.name ? <li style={{listStyleType: "none"}}>
|
|
23
|
+
<span><a href={data.url} target="_blank" rel="noreferrer nofollow noopener" >{data.name}</a></span>
|
|
24
|
+
</li> : null}
|
|
25
|
+
<br></br>
|
|
26
|
+
</li>
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div>
|
|
31
|
+
<div className={"cm-modal-header " + theme}>Resources</div>
|
|
32
|
+
|
|
33
|
+
<div
|
|
34
|
+
className="cm-modal-body"
|
|
35
|
+
style={{ height: 290, top: 0, bottom: 0, left: 0, right: 0 }}
|
|
36
|
+
>
|
|
37
|
+
<div className="cm-form-group">
|
|
38
|
+
<div style={{
|
|
39
|
+
overflow: "auto scroll",
|
|
40
|
+
width: "875px",
|
|
41
|
+
height: "300px",
|
|
42
|
+
whiteSpace: "pre-wrap",}}>
|
|
43
|
+
<ul>{arrayDataItems}</ul>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div className="cm-modal-footer">
|
|
50
|
+
<br></br>
|
|
51
|
+
<br></br>
|
|
52
|
+
<br></br>
|
|
53
|
+
|
|
54
|
+
<button
|
|
55
|
+
style={{ textAlign: "left" }}
|
|
56
|
+
type="Close"
|
|
57
|
+
className={"cm-btn cm-btn-theme " + theme}
|
|
58
|
+
onClick={this.close}
|
|
59
|
+
>
|
|
60
|
+
Close
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default connect(
|
|
70
|
+
"selectTheme",
|
|
71
|
+
"selectResourceItems",
|
|
72
|
+
"doModalClose",
|
|
73
|
+
"doGetResourceData",
|
|
74
|
+
ResourcesModal
|
|
75
|
+
);
|
package/src/index.js
CHANGED
|
@@ -1,107 +1,109 @@
|
|
|
1
|
-
// core components
|
|
2
|
-
import Map from "./application-exports/map-provider";
|
|
3
|
-
import {
|
|
4
|
-
SearchInput,
|
|
5
|
-
SearchResultsList,
|
|
6
|
-
SearchResultsListItem,
|
|
7
|
-
SidebarButton,
|
|
8
|
-
SidebarPanelOpenerButton,
|
|
9
|
-
LoadingIndicator,
|
|
10
|
-
BasicToolbarButton,
|
|
11
|
-
BasicToolbarMenu,
|
|
12
|
-
BasicToolbarMenuUp,
|
|
13
|
-
BasicToolbarSubmenu,
|
|
14
|
-
BasicToolbarMenuDivider,
|
|
15
|
-
BasicToolbarMenuItem,
|
|
16
|
-
TreeView,
|
|
17
|
-
TreeList,
|
|
18
|
-
TreeListItem,
|
|
19
|
-
TreeListFolder,
|
|
20
|
-
} from "./application-controls";
|
|
21
|
-
|
|
22
|
-
// plugins
|
|
23
|
-
import addData from "./core-plugins/add-data";
|
|
24
|
-
import arcgisIdent from "./core-plugins/identify-arcgis-rest";
|
|
25
|
-
import basemapSwitcher from "./core-plugins/basemap-switcher";
|
|
26
|
-
import bookmarks from "./core-plugins/bookmarks";
|
|
27
|
-
import changeLog from "./core-plugins/change-log";
|
|
28
|
-
|
|
29
|
-
// import
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
import
|
|
33
|
-
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
// core components
|
|
2
|
+
import Map from "./application-exports/map-provider";
|
|
3
|
+
import {
|
|
4
|
+
SearchInput,
|
|
5
|
+
SearchResultsList,
|
|
6
|
+
SearchResultsListItem,
|
|
7
|
+
SidebarButton,
|
|
8
|
+
SidebarPanelOpenerButton,
|
|
9
|
+
LoadingIndicator,
|
|
10
|
+
BasicToolbarButton,
|
|
11
|
+
BasicToolbarMenu,
|
|
12
|
+
BasicToolbarMenuUp,
|
|
13
|
+
BasicToolbarSubmenu,
|
|
14
|
+
BasicToolbarMenuDivider,
|
|
15
|
+
BasicToolbarMenuItem,
|
|
16
|
+
TreeView,
|
|
17
|
+
TreeList,
|
|
18
|
+
TreeListItem,
|
|
19
|
+
TreeListFolder,
|
|
20
|
+
} from "./application-controls";
|
|
21
|
+
|
|
22
|
+
// plugins
|
|
23
|
+
import addData from "./core-plugins/add-data";
|
|
24
|
+
import arcgisIdent from "./core-plugins/identify-arcgis-rest";
|
|
25
|
+
import basemapSwitcher from "./core-plugins/basemap-switcher";
|
|
26
|
+
import bookmarks from "./core-plugins/bookmarks";
|
|
27
|
+
import changeLog from "./core-plugins/change-log";
|
|
28
|
+
import resources from "./core-plugins/resources";
|
|
29
|
+
// import catalog from './core-plugins/catalog';
|
|
30
|
+
// import cmIdent from './core-plugins/identify-cm';
|
|
31
|
+
|
|
32
|
+
import coordDisplay from "./core-plugins/coordinate-display";
|
|
33
|
+
import draw from "./core-plugins/draw-tools";
|
|
34
|
+
// import editor from './core-plugins/editor';
|
|
35
|
+
import geocoder from "./core-plugins/geocoder";
|
|
36
|
+
import geojsonIdent from "./core-plugins/identify-geojson";
|
|
37
|
+
import esriIdent from "./core-plugins/identify-arcgis-rest";
|
|
38
|
+
import identify from "./core-plugins/identify";
|
|
39
|
+
import legend from "./core-plugins/legend";
|
|
40
|
+
// import login from './core-plugins/login';
|
|
41
|
+
import measureTools from "./core-plugins/measure-tools";
|
|
42
|
+
import permalink from "./core-plugins/permalink";
|
|
43
|
+
import printMap from "./core-plugins/print-map";
|
|
44
|
+
import questionsTab from "./core-plugins/contact-form"
|
|
45
|
+
import rasterIdent from "./core-plugins/identify-raster";
|
|
46
|
+
import rotateNorth from "./core-plugins/rotate-north";
|
|
47
|
+
import themeSwitcher from "./core-plugins/theme-switcher";
|
|
48
|
+
import treeView from "./core-plugins/tree-view";
|
|
49
|
+
import treeViewPanel from "./core-plugins/tree-view/tree-view-panel";
|
|
50
|
+
import vectorIdent from "./core-plugins/identify-vector";
|
|
51
|
+
import vectorSearch from "./core-plugins/vector-search";
|
|
52
|
+
import zoomInOut from "./core-plugins/zoom-in-out";
|
|
53
|
+
import zoomLevel from "./core-plugins/zoom-level";
|
|
54
|
+
import zoomHome from "./core-plugins/zoom-home";
|
|
55
|
+
import zoomToBox from "./core-plugins/zoom-to-box";
|
|
56
|
+
import mapLoadingIndicator from "./core-plugins/map-loading-indicator";
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
Map,
|
|
60
|
+
SearchInput,
|
|
61
|
+
SearchResultsList,
|
|
62
|
+
SearchResultsListItem,
|
|
63
|
+
SidebarButton,
|
|
64
|
+
SidebarPanelOpenerButton,
|
|
65
|
+
LoadingIndicator,
|
|
66
|
+
BasicToolbarButton,
|
|
67
|
+
BasicToolbarMenu,
|
|
68
|
+
BasicToolbarMenuUp,
|
|
69
|
+
BasicToolbarSubmenu,
|
|
70
|
+
BasicToolbarMenuDivider,
|
|
71
|
+
BasicToolbarMenuItem,
|
|
72
|
+
TreeView,
|
|
73
|
+
TreeList,
|
|
74
|
+
TreeListItem,
|
|
75
|
+
TreeListFolder,
|
|
76
|
+
addData,
|
|
77
|
+
arcgisIdent,
|
|
78
|
+
basemapSwitcher,
|
|
79
|
+
bookmarks,
|
|
80
|
+
changeLog,
|
|
81
|
+
resources,
|
|
82
|
+
// catalog,
|
|
83
|
+
// cmIdent,
|
|
84
|
+
zoomLevel,
|
|
85
|
+
coordDisplay,
|
|
86
|
+
draw,
|
|
87
|
+
// editor,
|
|
88
|
+
geocoder,
|
|
89
|
+
geojsonIdent,
|
|
90
|
+
esriIdent,
|
|
91
|
+
identify,
|
|
92
|
+
legend,
|
|
93
|
+
// login,
|
|
94
|
+
mapLoadingIndicator,
|
|
95
|
+
measureTools,
|
|
96
|
+
permalink,
|
|
97
|
+
printMap,
|
|
98
|
+
questionsTab,
|
|
99
|
+
rasterIdent,
|
|
100
|
+
rotateNorth,
|
|
101
|
+
themeSwitcher,
|
|
102
|
+
treeView,
|
|
103
|
+
treeViewPanel,
|
|
104
|
+
vectorIdent,
|
|
105
|
+
vectorSearch,
|
|
106
|
+
zoomInOut,
|
|
107
|
+
zoomHome,
|
|
108
|
+
zoomToBox,
|
|
109
|
+
};
|