@corpsmap/corpsmap 3.2.81 → 3.2.82
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/.babelrc +2 -10
- package/css/corpsmap.css +9753 -9753
- package/lib/dev.js +67517 -73596
- package/lib/prod.js +67514 -72274
- package/package.json +29 -35
- package/rollup.config.js +21 -23
- package/src/application-bundles/api-bundle.js +32 -34
- package/src/application-bundles/map-layers-bundle.js +33 -38
- package/src/application-bundles/notification-bundle.js +31 -35
- package/src/application-bundles/south-region-bundle.js +41 -49
- package/src/application-bundles-old/ui-bundle.js +180 -240
- package/src/core-plugins/add-data/bundle.js +1 -2
- package/src/core-plugins/basemap-switcher/basemap-switcher-list-item copy.js +59 -0
- package/src/core-plugins/change-log/change-log-modal.js +2 -2
- package/src/core-plugins/coordinate-display/bundle.js +166 -189
- package/lib/assets/index-42a6cd56.css +0 -10185
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corpsmap/corpsmap",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.82",
|
|
4
4
|
"description": "CorpsMap as React Components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,44 +16,37 @@
|
|
|
16
16
|
"author": "willbreitkreutz",
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@babel/
|
|
20
|
-
"@babel/
|
|
21
|
-
"@babel/
|
|
22
|
-
"@babel/
|
|
23
|
-
"
|
|
24
|
-
"@babel/preset-env": "^7.28.5",
|
|
25
|
-
"@babel/preset-react": "^7.28.5",
|
|
26
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
27
|
-
"@rollup/plugin-commonjs": "^28.0.9",
|
|
28
|
-
"@rollup/plugin-json": "^6.0.0",
|
|
29
|
-
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
30
|
-
"@rollup/plugin-replace": "^6.0.2",
|
|
31
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
32
|
-
"babel-loader": "^10.0.0",
|
|
33
|
-
"babel-plugin-import": "^1.13.8",
|
|
19
|
+
"@babel/core": "^7.5.5",
|
|
20
|
+
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
|
21
|
+
"@babel/preset-env": "^7.5.5",
|
|
22
|
+
"@babel/preset-react": "^7.0.0",
|
|
23
|
+
"babel-plugin-import": "^1.12.2",
|
|
34
24
|
"concurrently": "^5.3.0",
|
|
35
25
|
"cross-env": "^5.2.0",
|
|
36
|
-
"
|
|
37
|
-
"react": "^
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"rollup": "^
|
|
41
|
-
"rollup-plugin-css-only": "^
|
|
26
|
+
"react": "^16.9.0",
|
|
27
|
+
"react-dom": "^16.9.0",
|
|
28
|
+
"rollup": "^1.20.2",
|
|
29
|
+
"rollup-plugin-babel": "^4.3.3",
|
|
30
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
31
|
+
"rollup-plugin-css-only": "^1.0.0",
|
|
32
|
+
"rollup-plugin-json": "^4.0.0",
|
|
33
|
+
"rollup-plugin-node-resolve": "^5.2.0",
|
|
42
34
|
"rollup-plugin-postcss": "^2.0.3",
|
|
43
|
-
"
|
|
35
|
+
"rollup-plugin-replace": "^2.2.0",
|
|
36
|
+
"styled-jsx": "^3.2.1",
|
|
44
37
|
"wait-on": "^5.2.1"
|
|
45
38
|
},
|
|
46
39
|
"peerDependencies": {
|
|
47
|
-
"react": ">=
|
|
48
|
-
"react-dom": ">=
|
|
40
|
+
"react": ">= 16.x.x",
|
|
41
|
+
"react-dom": ">=16.x.x"
|
|
49
42
|
},
|
|
50
43
|
"dependencies": {
|
|
51
44
|
"@mapbox/togeojson": "^0.16.0",
|
|
52
|
-
"@turf/bbox": "^
|
|
53
|
-
"@turf/bbox-polygon": "^
|
|
54
|
-
"@turf/boolean-crosses": "^
|
|
55
|
-
"@turf/boolean-disjoint": "^
|
|
56
|
-
"@turf/boolean-point-in-polygon": "^
|
|
45
|
+
"@turf/bbox": "^6.0.1",
|
|
46
|
+
"@turf/bbox-polygon": "^6.0.1",
|
|
47
|
+
"@turf/boolean-crosses": "^6.0.1",
|
|
48
|
+
"@turf/boolean-disjoint": "^6.0.2",
|
|
49
|
+
"@turf/boolean-point-in-polygon": "^6.0.1",
|
|
57
50
|
"@turf/buffer": "^5.1.5",
|
|
58
51
|
"@turf/center-of-mass": "^6.0.1",
|
|
59
52
|
"@turf/centroid": "^6.0.2",
|
|
@@ -69,7 +62,7 @@
|
|
|
69
62
|
"extract-files": "^12.0.0",
|
|
70
63
|
"file-saver": "^2.0.2",
|
|
71
64
|
"is-html": "^2.0.0",
|
|
72
|
-
"jspdf": "^
|
|
65
|
+
"jspdf": "^1.5.3",
|
|
73
66
|
"kmljs": "0.0.1",
|
|
74
67
|
"lodash": "^4.17.15",
|
|
75
68
|
"markdown-it": "^12.0.3",
|
|
@@ -77,17 +70,18 @@
|
|
|
77
70
|
"money-clip": "^3.0.1",
|
|
78
71
|
"ol": "^6.4.3",
|
|
79
72
|
"ol-esri-style": "^2.0.7",
|
|
73
|
+
"parse2-kmz": "^1.0.5",
|
|
80
74
|
"proj4": "^2.4.4",
|
|
81
|
-
"react-data-grid": "
|
|
82
|
-
"react-datepicker": "^
|
|
83
|
-
"react-select": "^5.10.2",
|
|
75
|
+
"react-data-grid": "^6.1.0",
|
|
76
|
+
"react-datepicker": "^2.9.6",
|
|
84
77
|
"react-dnd": "^9.4.0",
|
|
85
78
|
"react-dnd-html5-backend": "^9.4.0",
|
|
79
|
+
"react-notification-system": "^0.2.17",
|
|
86
80
|
"react-split": "^2.0.7",
|
|
87
81
|
"redux-bundler": "^26.0.0",
|
|
88
82
|
"redux-bundler-react": "^1.2.0",
|
|
89
83
|
"shpjs": "^3.4.3",
|
|
90
|
-
"uuid": "^
|
|
84
|
+
"uuid": "^3.3.3",
|
|
91
85
|
"xhr": "^2.5.0"
|
|
92
86
|
}
|
|
93
87
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import babel from "
|
|
2
|
-
import commonjs from "
|
|
3
|
-
import resolve from "
|
|
4
|
-
import replace from "
|
|
1
|
+
import babel from "rollup-plugin-babel";
|
|
2
|
+
import commonjs from "rollup-plugin-commonjs";
|
|
3
|
+
import resolve from "rollup-plugin-node-resolve";
|
|
4
|
+
import replace from "rollup-plugin-replace";
|
|
5
5
|
import css from "rollup-plugin-css-only";
|
|
6
|
-
import postcss from
|
|
7
|
-
import json from
|
|
8
|
-
import pkg from
|
|
9
|
-
|
|
6
|
+
import postcss from 'rollup-plugin-postcss';
|
|
7
|
+
import json from 'rollup-plugin-json';
|
|
8
|
+
import pkg from './package.json';
|
|
9
|
+
|
|
10
10
|
|
|
11
11
|
const NODE_ENV = process.env.NODE_ENV || "development";
|
|
12
12
|
const outputFile = NODE_ENV === "production" ? "./lib/prod.js" : "./lib/dev.js";
|
|
@@ -15,38 +15,36 @@ export default {
|
|
|
15
15
|
input: "./src/index.js",
|
|
16
16
|
output: {
|
|
17
17
|
file: outputFile,
|
|
18
|
-
format: "cjs"
|
|
18
|
+
format: "cjs"
|
|
19
19
|
},
|
|
20
20
|
plugins: [
|
|
21
21
|
replace({
|
|
22
|
-
"process.env.NODE_ENV": JSON.stringify(NODE_ENV)
|
|
22
|
+
"process.env.NODE_ENV": JSON.stringify(NODE_ENV)
|
|
23
23
|
}),
|
|
24
24
|
babel({
|
|
25
|
-
plugins:
|
|
26
|
-
extensions: [
|
|
27
|
-
exclude: "node_modules/**"
|
|
28
|
-
babelHelpers: "bundled",
|
|
25
|
+
plugins:[['import', { libraryName: 'antd', style: true }]],
|
|
26
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
27
|
+
exclude: "node_modules/**"
|
|
29
28
|
}),
|
|
30
29
|
css({
|
|
31
|
-
|
|
32
|
-
extract: path.resolve("./css/corpsmap.css"),
|
|
30
|
+
output: "./css/corpsmap.css"
|
|
33
31
|
}),
|
|
34
32
|
resolve({
|
|
35
33
|
module: true,
|
|
36
34
|
jsnext: true,
|
|
37
35
|
customResolveOptions: {
|
|
38
|
-
moduleDirectory:
|
|
39
|
-
}
|
|
36
|
+
moduleDirectory: 'node_modules'
|
|
37
|
+
}
|
|
40
38
|
}),
|
|
41
39
|
json(),
|
|
42
40
|
commonjs(),
|
|
43
41
|
postcss({
|
|
44
|
-
extensions: [
|
|
45
|
-
use: [
|
|
46
|
-
})
|
|
42
|
+
extensions: ['.css', '.scss', '.less'],
|
|
43
|
+
use: ['sass', ['less', { javascriptEnabled: true }]],
|
|
44
|
+
})
|
|
47
45
|
],
|
|
48
46
|
external: [
|
|
49
47
|
...Object.keys(pkg.devDependencies || {}),
|
|
50
|
-
...Object.keys(pkg.peerDependencies || {})
|
|
51
|
-
]
|
|
48
|
+
...Object.keys(pkg.peerDependencies || {})
|
|
49
|
+
]
|
|
52
50
|
};
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
import xhr from
|
|
1
|
+
import xhr from 'xhr';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
name:
|
|
4
|
+
name: 'api',
|
|
5
5
|
|
|
6
6
|
getReducer: () => {
|
|
7
|
-
const root = `${process.env.REACT_APP_CM_ENV}`;
|
|
8
7
|
const initialData = {
|
|
9
|
-
root:
|
|
10
|
-
}
|
|
8
|
+
root: process.env.REACT_APP_CM_ENV
|
|
9
|
+
}
|
|
11
10
|
|
|
12
11
|
return (state = initialData, { type, payload }) => {
|
|
13
12
|
return state;
|
|
14
|
-
}
|
|
13
|
+
}
|
|
15
14
|
},
|
|
16
15
|
|
|
17
16
|
selectApiRoot: (state) => {
|
|
18
|
-
return process.env.NODE_ENV
|
|
19
|
-
? state.api.root
|
|
20
|
-
: state.windowLocation.origin;
|
|
17
|
+
return process.env.NODE_ENV==='development' ? state.api.root : state.windowLocation.origin;
|
|
21
18
|
},
|
|
22
19
|
|
|
23
20
|
getExtraArgs: (store) => {
|
|
21
|
+
|
|
24
22
|
return {
|
|
25
23
|
anonGet: (path, callback) => {
|
|
26
24
|
const options = {
|
|
27
|
-
url: path
|
|
28
|
-
}
|
|
29
|
-
xhr.get(options, callback)
|
|
25
|
+
url: path
|
|
26
|
+
}
|
|
27
|
+
xhr.get(options, callback)
|
|
30
28
|
},
|
|
31
29
|
|
|
32
30
|
apiGet: (path, callback) => {
|
|
33
31
|
// const token = store.selectTokenRaw();
|
|
34
32
|
const token = null;
|
|
35
33
|
const options = {
|
|
36
|
-
url: path
|
|
37
|
-
}
|
|
38
|
-
if
|
|
34
|
+
url: path
|
|
35
|
+
}
|
|
36
|
+
if(token){
|
|
39
37
|
options.headers = {
|
|
40
|
-
Authorization: "Bearer " + token
|
|
41
|
-
}
|
|
38
|
+
Authorization: "Bearer " + token
|
|
39
|
+
}
|
|
42
40
|
}
|
|
43
|
-
xhr.get(options, callback)
|
|
41
|
+
xhr.get(options, callback)
|
|
44
42
|
},
|
|
45
43
|
|
|
46
44
|
apiPost: (path, payload, callback) => {
|
|
@@ -48,29 +46,29 @@ export default {
|
|
|
48
46
|
const token = null;
|
|
49
47
|
const options = {
|
|
50
48
|
url: path,
|
|
51
|
-
json: payload
|
|
52
|
-
}
|
|
53
|
-
if
|
|
49
|
+
json: payload
|
|
50
|
+
}
|
|
51
|
+
if(token){
|
|
54
52
|
options.headers = {
|
|
55
|
-
Authorization: "Bearer " + token
|
|
56
|
-
}
|
|
53
|
+
Authorization: "Bearer " + token
|
|
54
|
+
}
|
|
57
55
|
}
|
|
58
|
-
xhr.post(options, callback)
|
|
56
|
+
xhr.post(options, callback)
|
|
59
57
|
},
|
|
60
58
|
|
|
61
59
|
apiDel: (path, callback) => {
|
|
62
60
|
// const token = store.selectTokenRaw();
|
|
63
61
|
const token = null;
|
|
64
62
|
const options = {
|
|
65
|
-
url: path
|
|
66
|
-
}
|
|
67
|
-
if
|
|
63
|
+
url: path
|
|
64
|
+
}
|
|
65
|
+
if(token){
|
|
68
66
|
options.headers = {
|
|
69
|
-
Authorization: "Bearer " + token
|
|
70
|
-
}
|
|
67
|
+
Authorization: "Bearer " + token
|
|
68
|
+
}
|
|
71
69
|
}
|
|
72
|
-
xhr.del(options, callback)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
70
|
+
xhr.del(options, callback)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getLayer } from "../openlayers-utils/layer-utilities";
|
|
2
|
-
import
|
|
2
|
+
import v4 from "uuid/v4";
|
|
3
3
|
import { createSelector } from "redux-bundler";
|
|
4
4
|
import scaleToMapZoom from "../utils/scale-to-zoom-level";
|
|
5
5
|
|
|
@@ -109,7 +109,7 @@ export default {
|
|
|
109
109
|
favoriteLayers: [],
|
|
110
110
|
userDefaultLayers: [],
|
|
111
111
|
overrideSortLayerOrder: false,
|
|
112
|
-
sortOrderStatus: false
|
|
112
|
+
sortOrderStatus: false
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
return (state = initialData, { type, payload }) => {
|
|
@@ -133,7 +133,7 @@ export default {
|
|
|
133
133
|
resetNeeded: false,
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
if (type === "LAYERS_ORDER_OVERRIDE_SORT_ORDER") {
|
|
138
138
|
return Object.assign({}, state, payload);
|
|
139
139
|
}
|
|
@@ -196,24 +196,21 @@ export default {
|
|
|
196
196
|
Object.keys(layers).forEach((uid) => {
|
|
197
197
|
const lyr = layers[uid];
|
|
198
198
|
lyr.passFilter = false;
|
|
199
|
-
const hasString =
|
|
200
|
-
|
|
201
|
-
-1;
|
|
199
|
+
const hasString = lyr.displayName.toUpperCase().indexOf(filterString.toUpperCase()) !== -1;
|
|
200
|
+
|
|
202
201
|
|
|
203
202
|
if (lyr.groupTag && lyr.groupTag.length > 0) {
|
|
204
203
|
lyr.groupTag.forEach((tag) => {
|
|
205
|
-
const hasTag =
|
|
206
|
-
tag &&
|
|
207
|
-
tag.toUpperCase().indexOf(filterString.toUpperCase()) !== -1;
|
|
204
|
+
const hasTag = tag && tag.toUpperCase().indexOf(filterString.toUpperCase()) !== -1;
|
|
208
205
|
if (hasTag) {
|
|
209
206
|
lyr.passFilter = true;
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
|
-
}
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
}
|
|
213
210
|
|
|
214
211
|
if (hasString) {
|
|
215
212
|
lyr.passFilter = true;
|
|
216
|
-
}
|
|
213
|
+
}
|
|
217
214
|
});
|
|
218
215
|
|
|
219
216
|
Object.keys(layers).forEach((uid) => {
|
|
@@ -537,15 +534,16 @@ export default {
|
|
|
537
534
|
type: "LAYERS_LIST_UPDATED",
|
|
538
535
|
payload: Object.assign({}, layers),
|
|
539
536
|
});
|
|
540
|
-
|
|
541
|
-
if
|
|
537
|
+
|
|
538
|
+
if(node.visible && node.layerFunction && node.layerParams) {
|
|
542
539
|
const params = node.layerParams;
|
|
543
540
|
const layerFunction = node.layerFunction;
|
|
544
541
|
const storeFunction = store[layerFunction];
|
|
545
|
-
if
|
|
542
|
+
if(storeFunction) {
|
|
546
543
|
storeFunction(params);
|
|
547
544
|
}
|
|
548
545
|
}
|
|
546
|
+
|
|
549
547
|
},
|
|
550
548
|
|
|
551
549
|
doLayerSetLabels:
|
|
@@ -614,9 +612,10 @@ export default {
|
|
|
614
612
|
function setOrder(node) {
|
|
615
613
|
let sortOrder = o--;
|
|
616
614
|
if (node.mapLayer) {
|
|
617
|
-
if
|
|
615
|
+
if(overrideSortOrder) {
|
|
618
616
|
node.mapLayer.setZIndex(node.sortOrder);
|
|
619
|
-
}
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
620
619
|
node.sortOrder = sortOrder;
|
|
621
620
|
node.mapLayer.setZIndex(sortOrder);
|
|
622
621
|
}
|
|
@@ -705,29 +704,25 @@ export default {
|
|
|
705
704
|
payload: Object.assign({}, layers),
|
|
706
705
|
});
|
|
707
706
|
},
|
|
708
|
-
|
|
709
|
-
doOverrideSortOrder:
|
|
710
|
-
(
|
|
711
|
-
|
|
707
|
+
|
|
708
|
+
doOverrideSortOrder: (setting) => ({ dispatch }) => {
|
|
709
|
+
dispatch({
|
|
710
|
+
type: "LAYERS_ORDER_OVERRIDE_SORT_ORDER",
|
|
711
|
+
payload: {
|
|
712
|
+
overrideSortLayerOrder: setting,
|
|
713
|
+
},
|
|
714
|
+
});
|
|
715
|
+
},
|
|
716
|
+
doShowLayerSortOrder: (bool) => ({ dispatch }) => {
|
|
717
|
+
if(bool){
|
|
712
718
|
dispatch({
|
|
713
|
-
type: "
|
|
719
|
+
type: "SORT_ORDER_NOW_SHOWING",
|
|
714
720
|
payload: {
|
|
715
|
-
|
|
721
|
+
sortOrderStatus: true,
|
|
716
722
|
},
|
|
717
723
|
});
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
(bool) =>
|
|
721
|
-
({ dispatch }) => {
|
|
722
|
-
if (bool) {
|
|
723
|
-
dispatch({
|
|
724
|
-
type: "SORT_ORDER_NOW_SHOWING",
|
|
725
|
-
payload: {
|
|
726
|
-
sortOrderStatus: true,
|
|
727
|
-
},
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
},
|
|
724
|
+
}
|
|
725
|
+
},
|
|
731
726
|
selectSortOrderStatus: (state) => {
|
|
732
727
|
return state.layers.sortOrderStatus;
|
|
733
728
|
},
|
|
@@ -802,7 +797,7 @@ export default {
|
|
|
802
797
|
selectLayerShowFilter: (state) => {
|
|
803
798
|
return state.layers.showFilter;
|
|
804
799
|
},
|
|
805
|
-
|
|
800
|
+
|
|
806
801
|
selectOverrideSortOrder: (state) => {
|
|
807
802
|
return state.layers.overrideSortLayerOrder;
|
|
808
803
|
},
|
|
@@ -1,55 +1,51 @@
|
|
|
1
|
-
import
|
|
1
|
+
import v4 from 'uuid/v4';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
name:
|
|
4
|
+
name: 'notifications',
|
|
5
5
|
|
|
6
|
-
getReducer()
|
|
7
|
-
const initialData = {}
|
|
6
|
+
getReducer(){
|
|
7
|
+
const initialData = {}
|
|
8
8
|
|
|
9
9
|
return (state = initialData, { type, payload }) => {
|
|
10
|
-
if
|
|
10
|
+
if(payload && payload.notification){
|
|
11
11
|
const uid = v4();
|
|
12
12
|
payload.notification.uid = uid;
|
|
13
13
|
return Object.assign({}, state, {
|
|
14
|
-
[uid]: payload.notification
|
|
15
|
-
})
|
|
14
|
+
[uid]: payload.notification
|
|
15
|
+
})
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
switch
|
|
19
|
-
case
|
|
20
|
-
case
|
|
18
|
+
switch(type){
|
|
19
|
+
case 'NOTIFICATIONS_FIRED':
|
|
20
|
+
case 'NOTIFICATIONS_DISMISSED':
|
|
21
21
|
return Object.assign({}, state, payload);
|
|
22
22
|
default:
|
|
23
23
|
return state;
|
|
24
24
|
}
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
},
|
|
27
27
|
|
|
28
|
-
doNotificationsFire:
|
|
29
|
-
(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
},
|
|
28
|
+
doNotificationsFire: (options) => ({ dispatch, store }) => {
|
|
29
|
+
const uid = v4();
|
|
30
|
+
options.uid = uid;
|
|
31
|
+
dispatch({
|
|
32
|
+
type: 'NOTIFICATIONS_FIRED',
|
|
33
|
+
payload: {
|
|
34
|
+
[uid]: options
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
},
|
|
40
38
|
|
|
41
|
-
doNotificationsDismiss:
|
|
42
|
-
(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
50
|
-
},
|
|
39
|
+
doNotificationsDismiss: (uid) => ({ dispatch, store }) => {
|
|
40
|
+
const state = store.selectNotifications();
|
|
41
|
+
delete state[uid];
|
|
42
|
+
dispatch({
|
|
43
|
+
type: 'NOTIFICATIONS_DISMISSED',
|
|
44
|
+
payload: state
|
|
45
|
+
})
|
|
46
|
+
},
|
|
51
47
|
|
|
52
48
|
selectNotifications: (state) => {
|
|
53
49
|
return state.notifications;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { v4 as uuidv4 } from "uuid";
|
|
1
|
+
import v4 from "uuid/v4";
|
|
3
2
|
import { createSelector } from "redux-bundler";
|
|
4
3
|
|
|
5
4
|
export default {
|
|
@@ -24,59 +23,51 @@ export default {
|
|
|
24
23
|
};
|
|
25
24
|
},
|
|
26
25
|
|
|
27
|
-
doSouthRegionOpen:
|
|
28
|
-
(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
children: {},
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
},
|
|
26
|
+
doSouthRegionOpen: (options) => ({ dispatch, store }) => {
|
|
27
|
+
const children = store.selectSouthRegionChildrenObj();
|
|
28
|
+
const uid = v4();
|
|
29
|
+
options.uid = uid;
|
|
30
|
+
dispatch({
|
|
31
|
+
type: "SOUTH_REGION_OPENED",
|
|
32
|
+
payload: {
|
|
33
|
+
children: { ...children, [uid]: options },
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
doSouthRegionClose: () => ({ dispatch, store }) => {
|
|
38
|
+
dispatch({
|
|
39
|
+
type: "SOUTH_REGION_CLOSED",
|
|
40
|
+
payload: {
|
|
41
|
+
children: {},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
},
|
|
50
45
|
|
|
51
|
-
doSouthRegionCloseTab:
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
},
|
|
46
|
+
doSouthRegionCloseTab: (uid) => ({ dispatch, store }) => {
|
|
47
|
+
const children = store.selectSouthRegionChildrenObj();
|
|
48
|
+
delete children[uid];
|
|
49
|
+
dispatch({
|
|
50
|
+
type: "SOUTH_REGION_TAB_CLOSED",
|
|
51
|
+
payload: {
|
|
52
|
+
children: { ...children },
|
|
53
|
+
_shouldTryToCloseRegion: true,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
},
|
|
64
57
|
|
|
65
|
-
doSouthRegionTryClose:
|
|
66
|
-
(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (!children.length) store.doSouthRegionClose();
|
|
74
|
-
},
|
|
58
|
+
doSouthRegionTryClose: () => ({ dispatch, store }) => {
|
|
59
|
+
dispatch({
|
|
60
|
+
type: "SOUTH_REGION_TRY_CLOSE",
|
|
61
|
+
payload: { _shouldTryToCloseRegion: false },
|
|
62
|
+
});
|
|
63
|
+
const children = store.selectSouthRegionChildren();
|
|
64
|
+
if (!children.length) store.doSouthRegionClose();
|
|
65
|
+
},
|
|
75
66
|
|
|
76
67
|
selectSouthRegionChildrenObj: (state) => {
|
|
77
68
|
return state.southRegion.children;
|
|
78
69
|
},
|
|
79
|
-
|
|
70
|
+
|
|
80
71
|
selectSouthRegionChildren: createSelector(
|
|
81
72
|
"selectSouthRegionChildrenObj",
|
|
82
73
|
(children) => {
|
|
@@ -93,4 +84,5 @@ export default {
|
|
|
93
84
|
if (state.southRegion._shouldTryToCloseRegion)
|
|
94
85
|
return { actionCreator: "doSouthRegionTryClose" };
|
|
95
86
|
},
|
|
87
|
+
|
|
96
88
|
};
|