@corpsmap/corpsmap 3.2.22 → 3.2.25
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 +335 -80
- package/lib/prod.js +335 -80
- package/package.json +1 -1
- package/src/core-plugins/change-log/bundle.js +106 -0
- package/src/core-plugins/change-log/change-log-button.js +49 -0
- package/src/core-plugins/change-log/change-log-modal.js +72 -0
- package/src/core-plugins/change-log/index.js +15 -0
- package/src/core-plugins/identify/listeners/arcgis.js +7 -3
- package/src/core-plugins/identify-arcgis-rest/bundle.js +2 -1
- package/src/core-plugins/identify-vector/bundle.js +1 -0
- package/src/index.js +2 -0
- package/src/openlayers-utils/format-utilities.js +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import ChangeLogModal from './change-log-modal';
|
|
2
|
+
const url = `${process.env.REACT_APP_FUDS_CHANGE_LOG_URL}`;
|
|
3
|
+
|
|
4
|
+
const testData = [
|
|
5
|
+
{
|
|
6
|
+
"id": 4713,
|
|
7
|
+
"environment": "Public and Internal GIS",
|
|
8
|
+
"change_type": "Data Change",
|
|
9
|
+
"description": "Update locations for project at Pyote AAF Ground Gunnery Range (K06TX0146)\r\n\r\nOLD COORDINATES:\r\nBombing Range (01) 31.5575 -102.879444\r\nGround Gunnery Range (02) 31.585556 -102.898056\r\nSkeet Range (03) 31.553056 -102.875278\r\n\r\nNEW COORDINATES:\r\nBOMBING RANGE (01) 31.501163 -103.137657\r\nGROUND GUNNERY RANGE (02) 31.586237 -103.101082\r\nSKEET RANGE (03) 31.553096 -103.124618",
|
|
10
|
+
"create_date": "2023-08-23T15:41:24Z"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": 4714,
|
|
14
|
+
"environment": "Public and Internal GIS",
|
|
15
|
+
"change_type": "Data Change",
|
|
16
|
+
"description": "Update locations for project at Pyote AAF Ground Gunnery Range (K06TX0146)\r\n\r\nOLD COORDINATES:\r\nBombing Range (01) 31.5575 -102.879444\r\nGround Gunnery Range (02) 31.585556 -102.898056\r\nSkeet Range (03) 31.553056 -102.875278\r\n\r\nNEW COORDINATES:\r\nBOMBING RANGE (01) 31.501163 -103.137657\r\nGROUND GUNNERY RANGE (02) 31.586237 -103.101082\r\nSKEET RANGE (03) 31.553096 -103.124618",
|
|
17
|
+
"create_date": "2023-08-23T15:41:24Z"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": 4715,
|
|
21
|
+
"environment": "Public and Internal GIS",
|
|
22
|
+
"change_type": "Data Change",
|
|
23
|
+
"description": "Update locations for project at Pyote AAF Ground Gunnery Range (K06TX0146)\r\n\r\nOLD COORDINATES:\r\nBombing Range (01) 31.5575 -102.879444\r\nGround Gunnery Range (02) 31.585556 -102.898056\r\nSkeet Range (03) 31.553056 -102.875278\r\n\r\nNEW COORDINATES:\r\nBOMBING RANGE (01) 31.501163 -103.137657\r\nGROUND GUNNERY RANGE (02) 31.586237 -103.101082\r\nSKEET RANGE (03) 31.553096 -103.124618",
|
|
24
|
+
"create_date": "2023-08-23T15:41:24Z"
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'changeLog',
|
|
30
|
+
|
|
31
|
+
getReducer: () => {
|
|
32
|
+
const initialData = {
|
|
33
|
+
items: testData,
|
|
34
|
+
renderModal: false,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (state = initialData, { type, payload }) => {
|
|
38
|
+
switch (type) {
|
|
39
|
+
case "CHANGE_LOG_LOAD_TEST_DATA":
|
|
40
|
+
case "CHANGE_LOG_LOAD_PRODUCTION_DATA":
|
|
41
|
+
case "CHANGE_LOG_MODAL_WINDOW_OPENED":
|
|
42
|
+
return Object.assign({}, state, payload);
|
|
43
|
+
default:
|
|
44
|
+
return state;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
doGetChangeLogData: () => ({dispatch, store, anonGet}) => {
|
|
50
|
+
anonGet(url, (err, response, body) => {
|
|
51
|
+
if (err || response.statusCode !== 200) {
|
|
52
|
+
// alert("Load Test Data Instead!")
|
|
53
|
+
dispatch({
|
|
54
|
+
type: "CHANGE_LOG_LOAD_TEST_DATA",
|
|
55
|
+
payload: { items: testData, renderModal: true },
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
} else {
|
|
59
|
+
try {
|
|
60
|
+
console.log("Production Change Log Data")
|
|
61
|
+
console.log(body)
|
|
62
|
+
let data = JSON.parse(body);
|
|
63
|
+
console.log('data')
|
|
64
|
+
console.log(data)
|
|
65
|
+
let items = data.items
|
|
66
|
+
console.log("ITEMS");
|
|
67
|
+
console.log(items)
|
|
68
|
+
debugger
|
|
69
|
+
dispatch({
|
|
70
|
+
type: "LOAD_PRODUCTION_DATA",
|
|
71
|
+
payload: { items: items, renderModal: true },
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
} catch (err) {
|
|
75
|
+
alert(" ! ! ! ERROR IN CATCH BLOCK ! ! ! ")
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
doOpenModalLog: () => ({dispatch, store}) => {
|
|
82
|
+
store.doModalOpen({
|
|
83
|
+
children: [ ChangeLogModal ],
|
|
84
|
+
options: {},
|
|
85
|
+
openedBy: 'ChangeLogButton'
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
dispatch({
|
|
90
|
+
type: "CHANGE_LOG_MODAL_WINDOW_OPENED",
|
|
91
|
+
payload: { renderModal: false },
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
selectChangeLogItems: (state) => {
|
|
97
|
+
return state.changeLog.items;
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
reactRenderChangeLogModal: (state) => {
|
|
101
|
+
if (state.changeLog.renderModal)
|
|
102
|
+
return { actionCreator: "doOpenModalLog" };
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { connect } from 'redux-bundler-react';
|
|
3
|
+
import { SidebarButton } from '../../application-controls/index';
|
|
4
|
+
import ChangeLogModal from './change-log-modal'
|
|
5
|
+
|
|
6
|
+
class ChangeLogButton extends React.Component {
|
|
7
|
+
constructor(props){
|
|
8
|
+
super(props);
|
|
9
|
+
this.handleClick = this.handleClick.bind(this);
|
|
10
|
+
this.openModalLog = this.openModalLog.bind(this);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
openModalLog() {
|
|
14
|
+
const { doModalOpen } = this.props;
|
|
15
|
+
doModalOpen( {
|
|
16
|
+
children: [ ChangeLogModal ],
|
|
17
|
+
options: {},
|
|
18
|
+
openedBy: 'ChangeLogButton'
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
handleClick(){
|
|
23
|
+
const { doGetChangeLogData } = this.props;
|
|
24
|
+
doGetChangeLogData();
|
|
25
|
+
// this.openModalLog();
|
|
26
|
+
// Load Data
|
|
27
|
+
// After Data is loaded change renderModal true
|
|
28
|
+
// Add a listener that does doModalOpend
|
|
29
|
+
// doGetChangeLogData();
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
render() {
|
|
34
|
+
return (
|
|
35
|
+
<SidebarButton
|
|
36
|
+
iconClass="mdi mdi-exclamation"
|
|
37
|
+
label="Change Log"
|
|
38
|
+
title="Change Log"
|
|
39
|
+
onClick={ this.handleClick }
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default connect(
|
|
46
|
+
"doModalOpen",
|
|
47
|
+
"doGetChangeLogData",
|
|
48
|
+
ChangeLogButton
|
|
49
|
+
);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "redux-bundler-react";
|
|
3
|
+
|
|
4
|
+
class ChangeLogModal extends React.Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
|
|
8
|
+
this.state = {};
|
|
9
|
+
this.close = this.close.bind(this);
|
|
10
|
+
// this.handleSubmit = this.handleSubmit.bind(this);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
close() {
|
|
14
|
+
const { doModalClose } = this.props;
|
|
15
|
+
doModalClose();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
render() {
|
|
19
|
+
|
|
20
|
+
const { theme, doGetChangeLogData, changeLogItems } = this.props;
|
|
21
|
+
// doGetChangeLogData();
|
|
22
|
+
debugger
|
|
23
|
+
const loginDataWk = changeLogItems;
|
|
24
|
+
const arrayDataItems = loginDataWk.map(data =>
|
|
25
|
+
<li key={data.id}>
|
|
26
|
+
<p>Environment: {data.environment}: {data.create_date}</p>
|
|
27
|
+
<p>Change Type: {data.change_type}</p>
|
|
28
|
+
<p>Description: {data.description}</p>
|
|
29
|
+
</li>
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
<div className={"cm-modal-header " + theme}>Change Log</div>
|
|
35
|
+
<div
|
|
36
|
+
className="cm-modal-body"
|
|
37
|
+
style={{ height: 290, top: 0, bottom: 0, left: 0, right: 0 }}
|
|
38
|
+
>
|
|
39
|
+
<div className="cm-form-group">
|
|
40
|
+
<div style={{ overflow: "auto scroll", width: "875px", height: "350px"}}>
|
|
41
|
+
<ul>{arrayDataItems}</ul>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div className="cm-modal-footer">
|
|
46
|
+
<br></br>
|
|
47
|
+
<br></br>
|
|
48
|
+
<br></br>
|
|
49
|
+
|
|
50
|
+
<button
|
|
51
|
+
style={{ textAlign: "left" }}
|
|
52
|
+
type="Close"
|
|
53
|
+
className={"cm-btn cm-btn-theme " + theme}
|
|
54
|
+
onClick={this.close}
|
|
55
|
+
>
|
|
56
|
+
Close
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default connect(
|
|
66
|
+
"selectTheme",
|
|
67
|
+
"selectChangeLogItems",
|
|
68
|
+
"doModalClose",
|
|
69
|
+
"doSubmitNotification",
|
|
70
|
+
"doGetChangeLogData",
|
|
71
|
+
ChangeLogModal
|
|
72
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import bundle from './bundle';
|
|
2
|
+
import changeLogButton from './change-log-button';
|
|
3
|
+
|
|
4
|
+
const plugin = {
|
|
5
|
+
pluginName: 'changeLog',
|
|
6
|
+
enabled: true,
|
|
7
|
+
bundle: bundle,
|
|
8
|
+
components:[{
|
|
9
|
+
component: changeLogButton,
|
|
10
|
+
region: 'right-sidebar-top',
|
|
11
|
+
sortOrder: 120,
|
|
12
|
+
}],
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default plugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import async from "async";
|
|
2
2
|
import EsriJSON from "ol/format/EsriJSON";
|
|
3
|
-
import { formatArcgisrest } from "../../../openlayers-utils/format-utilities";
|
|
3
|
+
import { formatArcgisrest, identifyColumnsArcgisrest } from "../../../openlayers-utils/format-utilities";
|
|
4
4
|
const esrijsonFormat = new EsriJSON();
|
|
5
5
|
|
|
6
6
|
function formatUrl(options) {
|
|
@@ -52,6 +52,7 @@ export default {
|
|
|
52
52
|
const queries = [];
|
|
53
53
|
const featureType = "Polygon";
|
|
54
54
|
const identifyFeature = store.doSetIdentifyFeature();
|
|
55
|
+
let excludedColumns = store.selectIdentifyColumnsExclude();
|
|
55
56
|
|
|
56
57
|
//https://developers.arcgis.com/rest/services-reference/enterprise/identify-map-service-.htm
|
|
57
58
|
const params = {
|
|
@@ -69,7 +70,7 @@ export default {
|
|
|
69
70
|
})
|
|
70
71
|
),
|
|
71
72
|
};
|
|
72
|
-
|
|
73
|
+
|
|
73
74
|
visibleLayers.forEach((visibleLayer) => {
|
|
74
75
|
if (
|
|
75
76
|
visibleLayer.identifyType &&
|
|
@@ -91,9 +92,11 @@ export default {
|
|
|
91
92
|
});
|
|
92
93
|
} else {
|
|
93
94
|
try {
|
|
94
|
-
|
|
95
|
+
let data = JSON.parse(body);
|
|
95
96
|
|
|
96
97
|
if (data.results.length) {
|
|
98
|
+
data = identifyColumnsArcgisrest(data, excludedColumns)
|
|
99
|
+
|
|
97
100
|
cb(null, {
|
|
98
101
|
dataset: visibleLayer.uid,
|
|
99
102
|
layerName: visibleLayer.displayName,
|
|
@@ -129,6 +132,7 @@ export default {
|
|
|
129
132
|
}
|
|
130
133
|
} catch (err) {
|
|
131
134
|
console.log(err);
|
|
135
|
+
|
|
132
136
|
cb(null, {
|
|
133
137
|
dataset: visibleLayer.uid,
|
|
134
138
|
layerName: visibleLayer.displayName,
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
({ store, anonGet }) => {
|
|
47
47
|
const coords = store.selectIdentifyCoordinates();
|
|
48
48
|
const visibleLayers = store.selectVisibleLayers();
|
|
49
|
-
let excludedColumns = store.selectIdentifyColumnsExclude()
|
|
49
|
+
let excludedColumns = store.selectIdentifyColumnsExclude();
|
|
50
50
|
let featureType = "Point";
|
|
51
51
|
|
|
52
52
|
if (!visibleLayers.length) return callback(null, []);
|
|
@@ -95,6 +95,7 @@ export default {
|
|
|
95
95
|
let data = JSON.parse(body);
|
|
96
96
|
data = identifyColumnsArcgisrest(data, excludedColumns)
|
|
97
97
|
//Column Filtering
|
|
98
|
+
|
|
98
99
|
if (visibleLayer.identifyFields) {
|
|
99
100
|
data.results.forEach((result) => {
|
|
100
101
|
if(result.attributes){
|
|
@@ -80,6 +80,7 @@ export default {
|
|
|
80
80
|
});
|
|
81
81
|
outFeatures = identifyColumnsArcgisvector(outFeatures, excludedColumns)
|
|
82
82
|
//Column Filtering
|
|
83
|
+
//Fix bug below only acting on layer 0
|
|
83
84
|
if (layers[0].identifyFields) {
|
|
84
85
|
outFeatures.forEach((feature) => {
|
|
85
86
|
if(feature.properties){
|
package/src/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import addData from "./core-plugins/add-data";
|
|
|
24
24
|
import arcgisIdent from "./core-plugins/identify-arcgis-rest";
|
|
25
25
|
import basemapSwitcher from "./core-plugins/basemap-switcher";
|
|
26
26
|
import bookmarks from "./core-plugins/bookmarks";
|
|
27
|
+
import changeLog from "./core-plugins/change-log";
|
|
27
28
|
// import catalog from './core-plugins/catalog';
|
|
28
29
|
// import cmIdent from './core-plugins/identify-cm';
|
|
29
30
|
|
|
@@ -75,6 +76,7 @@ export {
|
|
|
75
76
|
arcgisIdent,
|
|
76
77
|
basemapSwitcher,
|
|
77
78
|
bookmarks,
|
|
79
|
+
changeLog,
|
|
78
80
|
// catalog,
|
|
79
81
|
// cmIdent,
|
|
80
82
|
zoomLevel,
|