@opengeoweb/layer-select 12.1.2 → 12.3.0
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/index.esm.js +198 -217
- package/package.json +11 -11
- package/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +1 -0
- package/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialog.stories.d.ts +9 -0
- package/src/lib/components/ServiceOptionsDialog/ServiceOptionsDialogConnect.d.ts +0 -1
- package/src/lib/components/ServicePopup/ServicePopup.stories.d.ts +6 -41
- package/src/lib/store/listeners.d.ts +1 -1
- package/src/lib/store/reducer.d.ts +2 -2
- package/src/lib/store/selectors.d.ts +435 -37
- package/src/lib/store/store.d.ts +8 -8
- package/src/lib/store/types.d.ts +2 -2
- package/src/lib/store/utils.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -2,18 +2,18 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { useSelector, useDispatch } from 'react-redux';
|
|
5
|
-
import { CustomIconButton, FilterOption, ToolContainerDraggable, CustomAccordion, CustomToggleButton, CustomTooltip, SearchHighlight, SearchField, ToggleMenu } from '@opengeoweb/shared';
|
|
6
|
-
import { Filter, LayersAdd, Add, Cached, Edit, Visibility, Delete,
|
|
7
|
-
import { uiTypes, serviceActions, selectorMemoizationOptions, serviceSelectors, uiActions, getUserAddedServices, setUserAddedServices, layerActions, uiSelectors, layerSelectors, mapListener, serviceListener, layersListener,
|
|
5
|
+
import { CustomIconButton, FilterOption, ToolContainerDraggable, CustomAccordion, CustomToggleButton, CustomTooltip, SearchHighlight, SearchField, AlertBanner, ToggleMenu, CustomDialog } from '@opengeoweb/shared';
|
|
6
|
+
import { Filter, LayersAdd, Add, Cached, Edit, Visibility, Delete, Copy } from '@opengeoweb/theme';
|
|
7
|
+
import { uiTypes, serviceActions, selectorMemoizationOptions, serviceSelectors, uiActions, getUserAddedServices, setUserAddedServices, layerActions, uiSelectors, layerSelectors, mapListener, serviceListener, layersListener, openlayersListener, uiReducer, layerReducer, serviceReducer, mapReducer, useSetupDialog, mapSelectors, layerTypes } from '@opengeoweb/store';
|
|
8
8
|
import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, isAnyOf, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
9
9
|
import { compact, countBy, partition } from 'lodash';
|
|
10
10
|
import { snackbarListener, snackbarReducer, snackbarTypes, snackbarActions } from '@opengeoweb/snackbar';
|
|
11
|
-
import { Switch,
|
|
11
|
+
import { Switch, Grid, List, Box, Typography, useTheme, Backdrop, CircularProgress, Button, ListItem, ListItemText, LinearProgress, InputAdornment } from '@mui/material';
|
|
12
12
|
import 'i18next';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
14
|
import { FixedSizeList } from 'react-window';
|
|
15
15
|
import { getDimensionsList, LayerInfoButton } from '@opengeoweb/webmap-react';
|
|
16
|
-
import {
|
|
16
|
+
import { LayerType, webmapUtils, getWMSServiceId, queryWMSServiceInfo, queryWMSLayers, invalidateWMSGetCapabilities, clearImageCacheForAllMaps } from '@opengeoweb/webmap';
|
|
17
17
|
import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField } from '@opengeoweb/form-fields';
|
|
18
18
|
import { useFormContext } from 'react-hook-form';
|
|
19
19
|
|
|
@@ -741,9 +741,9 @@ function _regeneratorRuntime() {
|
|
|
741
741
|
function define(t, e, r) {
|
|
742
742
|
return Object.defineProperty(t, e, {
|
|
743
743
|
value: r,
|
|
744
|
-
enumerable:
|
|
745
|
-
configurable:
|
|
746
|
-
writable:
|
|
744
|
+
enumerable: true,
|
|
745
|
+
configurable: true,
|
|
746
|
+
writable: true
|
|
747
747
|
}), t[e];
|
|
748
748
|
}
|
|
749
749
|
try {
|
|
@@ -836,7 +836,7 @@ function _regeneratorRuntime() {
|
|
|
836
836
|
if ("throw" === i) throw a;
|
|
837
837
|
return {
|
|
838
838
|
value: t,
|
|
839
|
-
done:
|
|
839
|
+
done: true
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
842
|
for (n.method = i, n.arg = a;;) {
|
|
@@ -887,7 +887,7 @@ function _regeneratorRuntime() {
|
|
|
887
887
|
function Context(t) {
|
|
888
888
|
this.tryEntries = [{
|
|
889
889
|
tryLoc: "root"
|
|
890
|
-
}], t.forEach(pushTryEntry, this), this.reset(
|
|
890
|
+
}], t.forEach(pushTryEntry, this), this.reset(true);
|
|
891
891
|
}
|
|
892
892
|
function values(e) {
|
|
893
893
|
if (e || "" === e) {
|
|
@@ -897,8 +897,8 @@ function _regeneratorRuntime() {
|
|
|
897
897
|
if (!isNaN(e.length)) {
|
|
898
898
|
var o = -1,
|
|
899
899
|
i = function next() {
|
|
900
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done =
|
|
901
|
-
return next.value = t, next.done =
|
|
900
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
|
|
901
|
+
return next.value = t, next.done = true, next;
|
|
902
902
|
};
|
|
903
903
|
return i.next = i;
|
|
904
904
|
}
|
|
@@ -907,10 +907,10 @@ function _regeneratorRuntime() {
|
|
|
907
907
|
}
|
|
908
908
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
909
909
|
value: GeneratorFunctionPrototype,
|
|
910
|
-
configurable:
|
|
910
|
+
configurable: true
|
|
911
911
|
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
912
912
|
value: GeneratorFunction,
|
|
913
|
-
configurable:
|
|
913
|
+
configurable: true
|
|
914
914
|
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
915
915
|
var e = "function" == typeof t && t.constructor;
|
|
916
916
|
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
@@ -939,17 +939,17 @@ function _regeneratorRuntime() {
|
|
|
939
939
|
return r.reverse(), function next() {
|
|
940
940
|
for (; r.length;) {
|
|
941
941
|
var t = r.pop();
|
|
942
|
-
if (t in e) return next.value = t, next.done =
|
|
942
|
+
if (t in e) return next.value = t, next.done = false, next;
|
|
943
943
|
}
|
|
944
|
-
return next.done =
|
|
944
|
+
return next.done = true, next;
|
|
945
945
|
};
|
|
946
946
|
}, e.values = values, Context.prototype = {
|
|
947
947
|
constructor: Context,
|
|
948
948
|
reset: function (e) {
|
|
949
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done =
|
|
949
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
950
950
|
},
|
|
951
951
|
stop: function () {
|
|
952
|
-
this.done =
|
|
952
|
+
this.done = true;
|
|
953
953
|
var t = this.tryEntries[0].completion;
|
|
954
954
|
if ("throw" === t.type) throw t.arg;
|
|
955
955
|
return this.rval;
|
|
@@ -968,10 +968,10 @@ function _regeneratorRuntime() {
|
|
|
968
968
|
var c = n.call(i, "catchLoc"),
|
|
969
969
|
u = n.call(i, "finallyLoc");
|
|
970
970
|
if (c && u) {
|
|
971
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
971
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
972
972
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
973
973
|
} else if (c) {
|
|
974
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
974
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
975
975
|
} else {
|
|
976
976
|
if (!u) throw Error("try statement without catch or finally");
|
|
977
977
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
@@ -1197,7 +1197,7 @@ var layerSelectReducersMap = {
|
|
|
1197
1197
|
ui: uiReducer,
|
|
1198
1198
|
snackbar: snackbarReducer
|
|
1199
1199
|
};
|
|
1200
|
-
var layerSelectMiddlewares = [mapListener.middleware, serviceListener.middleware, layersListener.middleware, layerSelectListener.middleware, snackbarListener.middleware];
|
|
1200
|
+
var layerSelectMiddlewares = [mapListener.middleware, serviceListener.middleware, layersListener.middleware, layerSelectListener.middleware, snackbarListener.middleware, openlayersListener.middleware];
|
|
1201
1201
|
var layerSelectRootReducer = combineReducers(layerSelectReducersMap);
|
|
1202
1202
|
var createMockStore = function createMockStore(mockState) {
|
|
1203
1203
|
return configureStore({
|
|
@@ -1335,7 +1335,7 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
1335
1335
|
onMouseDown: onMouseDown,
|
|
1336
1336
|
order: order,
|
|
1337
1337
|
source: source,
|
|
1338
|
-
children: [jsxs(
|
|
1338
|
+
children: [jsxs(Grid, {
|
|
1339
1339
|
container: true,
|
|
1340
1340
|
size: {
|
|
1341
1341
|
xs: 12
|
|
@@ -1348,7 +1348,7 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
1348
1348
|
top: 0,
|
|
1349
1349
|
zIndex: 100
|
|
1350
1350
|
},
|
|
1351
|
-
children: [jsx(
|
|
1351
|
+
children: [jsx(Grid, {
|
|
1352
1352
|
container: true,
|
|
1353
1353
|
size: {
|
|
1354
1354
|
xs: 6
|
|
@@ -1359,7 +1359,7 @@ var KeywordFilterResults = function KeywordFilterResults(_ref) {
|
|
|
1359
1359
|
padding: '15px 15px 0 24px'
|
|
1360
1360
|
},
|
|
1361
1361
|
children: t('select-all')
|
|
1362
|
-
}), jsx(
|
|
1362
|
+
}), jsx(Grid, {
|
|
1363
1363
|
container: true,
|
|
1364
1364
|
size: {
|
|
1365
1365
|
xs: 6
|
|
@@ -1619,7 +1619,7 @@ var LayerListRow = function LayerListRow(_ref) {
|
|
|
1619
1619
|
var rowHeight = widthToRowHeight(layerSelectWidth);
|
|
1620
1620
|
var columns = widthToColumns(layerSelectWidth);
|
|
1621
1621
|
var dimensions = getDimensionsList(layer.dimensions);
|
|
1622
|
-
return jsxs(
|
|
1622
|
+
return jsxs(Grid, {
|
|
1623
1623
|
"data-testid": "layerListLayerRow",
|
|
1624
1624
|
container: true,
|
|
1625
1625
|
justifyContent: "center",
|
|
@@ -1632,10 +1632,10 @@ var LayerListRow = function LayerListRow(_ref) {
|
|
|
1632
1632
|
border: 'solid 1px',
|
|
1633
1633
|
borderColor: 'geowebColors.cards.cardContainerBorder'
|
|
1634
1634
|
},
|
|
1635
|
-
children: [jsxs(
|
|
1635
|
+
children: [jsxs(Grid, {
|
|
1636
1636
|
container: true,
|
|
1637
1637
|
sx: columns.column8,
|
|
1638
|
-
children: [jsx(
|
|
1638
|
+
children: [jsx(Grid, {
|
|
1639
1639
|
size: {
|
|
1640
1640
|
xs: 12
|
|
1641
1641
|
},
|
|
@@ -1653,7 +1653,7 @@ var LayerListRow = function LayerListRow(_ref) {
|
|
|
1653
1653
|
search: searchFilter
|
|
1654
1654
|
})
|
|
1655
1655
|
})
|
|
1656
|
-
}), jsxs(
|
|
1656
|
+
}), jsxs(Grid, {
|
|
1657
1657
|
container: true,
|
|
1658
1658
|
direction: "column",
|
|
1659
1659
|
sx: columns.column1,
|
|
@@ -1673,9 +1673,9 @@ var LayerListRow = function LayerListRow(_ref) {
|
|
|
1673
1673
|
isActive: hasActiveLayer,
|
|
1674
1674
|
onClick: onToggleActiveLayer
|
|
1675
1675
|
})]
|
|
1676
|
-
}), jsxs(
|
|
1676
|
+
}), jsxs(Grid, {
|
|
1677
1677
|
sx: columns.column2,
|
|
1678
|
-
children: [jsx(
|
|
1678
|
+
children: [jsx(Grid, {
|
|
1679
1679
|
sx: columns.column3,
|
|
1680
1680
|
children: layer["abstract"] && jsx(Typography, {
|
|
1681
1681
|
"data-testid": "layerAbstract",
|
|
@@ -1685,15 +1685,15 @@ var LayerListRow = function LayerListRow(_ref) {
|
|
|
1685
1685
|
search: searchFilter
|
|
1686
1686
|
})
|
|
1687
1687
|
})
|
|
1688
|
-
}), jsxs(
|
|
1688
|
+
}), jsxs(Grid, {
|
|
1689
1689
|
container: true,
|
|
1690
1690
|
sx: columns.column4,
|
|
1691
|
-
children: [jsx(
|
|
1691
|
+
children: [jsx(Grid, {
|
|
1692
1692
|
sx: columns.column5,
|
|
1693
1693
|
children: jsx(LayerListDimensions, {
|
|
1694
1694
|
dimensions: dimensions
|
|
1695
1695
|
})
|
|
1696
|
-
}), jsxs(
|
|
1696
|
+
}), jsxs(Grid, {
|
|
1697
1697
|
sx: columns.column6,
|
|
1698
1698
|
children: [layer.path.length > 0 && jsxs(Typography, {
|
|
1699
1699
|
sx: layerInfoStyle,
|
|
@@ -1713,7 +1713,7 @@ var LayerListRow = function LayerListRow(_ref) {
|
|
|
1713
1713
|
})]
|
|
1714
1714
|
})]
|
|
1715
1715
|
})]
|
|
1716
|
-
}), jsx(
|
|
1716
|
+
}), jsx(Grid, {
|
|
1717
1717
|
container: true,
|
|
1718
1718
|
sx: columns.column9,
|
|
1719
1719
|
justifyContent: "flex-end",
|
|
@@ -2127,11 +2127,14 @@ var styles = {
|
|
|
2127
2127
|
header: {
|
|
2128
2128
|
position: 'sticky',
|
|
2129
2129
|
top: 0,
|
|
2130
|
-
fontSize: 'default',
|
|
2131
2130
|
padding: '12px',
|
|
2132
2131
|
backgroundColor: 'geowebColors.background.surface',
|
|
2133
2132
|
zIndex: 100
|
|
2134
2133
|
},
|
|
2134
|
+
text: {
|
|
2135
|
+
fontSize: 'default',
|
|
2136
|
+
opacity: 0.67
|
|
2137
|
+
},
|
|
2135
2138
|
loading: {
|
|
2136
2139
|
position: 'absolute',
|
|
2137
2140
|
zIndex: 101
|
|
@@ -2164,7 +2167,8 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
|
|
|
2164
2167
|
selectedLayers = _ref.selectedLayers,
|
|
2165
2168
|
setServicePopupInfo = _ref.setServicePopupInfo,
|
|
2166
2169
|
_ref$isLoading = _ref.isLoading,
|
|
2167
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading
|
|
2170
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
2171
|
+
error = _ref.error;
|
|
2168
2172
|
var _useLayerSelectTransl = useLayerSelectTranslation(),
|
|
2169
2173
|
t = _useLayerSelectTransl.t;
|
|
2170
2174
|
var openAddService = function openAddService() {
|
|
@@ -2188,9 +2192,15 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
|
|
|
2188
2192
|
},
|
|
2189
2193
|
tabIndex: -1,
|
|
2190
2194
|
ref: dialogRef,
|
|
2191
|
-
children: [
|
|
2195
|
+
children: [jsxs(Box, {
|
|
2192
2196
|
sx: styles.header,
|
|
2193
|
-
children:
|
|
2197
|
+
children: [jsx(Box, {
|
|
2198
|
+
sx: styles.text,
|
|
2199
|
+
children: t('services')
|
|
2200
|
+
}), error && jsx(AlertBanner, {
|
|
2201
|
+
title: error,
|
|
2202
|
+
shouldClose: true
|
|
2203
|
+
})]
|
|
2194
2204
|
}), jsx(Backdrop, {
|
|
2195
2205
|
sx: Object.assign({}, styles.loading, {
|
|
2196
2206
|
backgroundSize: 'cover'
|
|
@@ -2270,7 +2280,7 @@ var Rows = function Rows(_ref2) {
|
|
|
2270
2280
|
marginLeft: 1
|
|
2271
2281
|
}
|
|
2272
2282
|
},
|
|
2273
|
-
children: jsxs(
|
|
2283
|
+
children: jsxs(Grid, {
|
|
2274
2284
|
container: true,
|
|
2275
2285
|
justifyContent: "left",
|
|
2276
2286
|
sx: {
|
|
@@ -2475,22 +2485,17 @@ var getServiceSuccesUpdateMessage = function getServiceSuccesUpdateMessage(servi
|
|
|
2475
2485
|
}
|
|
2476
2486
|
};
|
|
2477
2487
|
};
|
|
2478
|
-
var getServiceFailedUpdateMessage = function getServiceFailedUpdateMessage(error) {
|
|
2479
|
-
var message = error.message;
|
|
2480
|
-
return {
|
|
2481
|
-
type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
|
|
2482
|
-
key: 'unable-to-update-service',
|
|
2483
|
-
params: {
|
|
2484
|
-
message: message
|
|
2485
|
-
}
|
|
2486
|
-
};
|
|
2487
|
-
};
|
|
2488
2488
|
var ServiceOptionsDialogConnect = function ServiceOptionsDialogConnect(_ref) {
|
|
2489
2489
|
var mapId = _ref.mapId;
|
|
2490
2490
|
var _React$useState = React.useState(false),
|
|
2491
2491
|
isLoading = _React$useState[0],
|
|
2492
2492
|
setIsLoading = _React$useState[1];
|
|
2493
|
+
var _React$useState2 = React.useState(undefined),
|
|
2494
|
+
error = _React$useState2[0],
|
|
2495
|
+
setError = _React$useState2[1];
|
|
2493
2496
|
var dispatch = useDispatch();
|
|
2497
|
+
var _useLayerSelectTransl = useLayerSelectTranslation(),
|
|
2498
|
+
t = _useLayerSelectTransl.t;
|
|
2494
2499
|
var serviceSetLayers = React.useCallback(function (payload) {
|
|
2495
2500
|
dispatch(serviceActions.serviceSetLayers(Object.assign({}, payload, {
|
|
2496
2501
|
isUpdating: true
|
|
@@ -2532,10 +2537,11 @@ var ServiceOptionsDialogConnect = function ServiceOptionsDialogConnect(_ref) {
|
|
|
2532
2537
|
while (1) switch (_context.prev = _context.next) {
|
|
2533
2538
|
case 0:
|
|
2534
2539
|
setIsLoading(true);
|
|
2535
|
-
|
|
2536
|
-
_context.
|
|
2540
|
+
setError(undefined);
|
|
2541
|
+
_context.prev = 2;
|
|
2542
|
+
_context.next = 5;
|
|
2537
2543
|
return loadWMSService(serviceUrl, true);
|
|
2538
|
-
case
|
|
2544
|
+
case 5:
|
|
2539
2545
|
layersForService = _context.sent;
|
|
2540
2546
|
service = getService(services, serviceUrl);
|
|
2541
2547
|
serviceSetLayers({
|
|
@@ -2550,35 +2556,36 @@ var ServiceOptionsDialogConnect = function ServiceOptionsDialogConnect(_ref) {
|
|
|
2550
2556
|
clearImageCacheForAllMaps();
|
|
2551
2557
|
serviceTitle = service && service.serviceName || layersForService.name;
|
|
2552
2558
|
showSnackbar(getServiceSuccesUpdateMessage(serviceTitle));
|
|
2553
|
-
_context.next =
|
|
2559
|
+
_context.next = 16;
|
|
2554
2560
|
break;
|
|
2555
|
-
case
|
|
2556
|
-
_context.prev =
|
|
2557
|
-
_context.t0 = _context["catch"](
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
case
|
|
2562
|
-
_context.prev =
|
|
2561
|
+
case 13:
|
|
2562
|
+
_context.prev = 13;
|
|
2563
|
+
_context.t0 = _context["catch"](2);
|
|
2564
|
+
setError(t('unable-to-update-service', {
|
|
2565
|
+
message: _context.t0.message
|
|
2566
|
+
}));
|
|
2567
|
+
case 16:
|
|
2568
|
+
_context.prev = 16;
|
|
2563
2569
|
setIsLoading(false);
|
|
2564
|
-
return _context.finish(
|
|
2565
|
-
case
|
|
2570
|
+
return _context.finish(16);
|
|
2571
|
+
case 19:
|
|
2566
2572
|
case "end":
|
|
2567
2573
|
return _context.stop();
|
|
2568
2574
|
}
|
|
2569
|
-
}, _callee, null, [[
|
|
2575
|
+
}, _callee, null, [[2, 13, 16, 19]]);
|
|
2570
2576
|
}));
|
|
2571
2577
|
return function (_x) {
|
|
2572
2578
|
return _ref2.apply(this, arguments);
|
|
2573
2579
|
};
|
|
2574
|
-
}(), [serviceSetLayers, services, showSnackbar]);
|
|
2580
|
+
}(), [serviceSetLayers, services, showSnackbar, t]);
|
|
2575
2581
|
return jsx(ServiceOptionsDialog, {
|
|
2576
2582
|
selectedLayers: selectedLayers,
|
|
2577
2583
|
services: services,
|
|
2578
2584
|
layerSelectRemoveService: layerSelectRemoveService,
|
|
2579
2585
|
layerSelectReloadService: layerSelectReloadService,
|
|
2580
2586
|
setServicePopupInfo: setServicePopupInfo,
|
|
2581
|
-
isLoading: isLoading
|
|
2587
|
+
isLoading: isLoading,
|
|
2588
|
+
error: error
|
|
2582
2589
|
});
|
|
2583
2590
|
};
|
|
2584
2591
|
|
|
@@ -2684,7 +2691,8 @@ var LayerSelect = function LayerSelect(_ref) {
|
|
|
2684
2691
|
},
|
|
2685
2692
|
children: jsx(KeywordFilterButtonConnect, {
|
|
2686
2693
|
mapId: mapId,
|
|
2687
|
-
isMultiMap: isMultiMap
|
|
2694
|
+
isMultiMap: isMultiMap,
|
|
2695
|
+
source: source
|
|
2688
2696
|
})
|
|
2689
2697
|
}), jsx(Box, {
|
|
2690
2698
|
sx: {
|
|
@@ -2912,177 +2920,150 @@ var ServicePopupUnwrapped = function ServicePopupUnwrapped(_ref2) {
|
|
|
2912
2920
|
var isSubmitDisabled = getFormHasformErrors() || getFormAreRequiredFieldsEmpty();
|
|
2913
2921
|
var isShowPopup = servicePopupVariant === 'show';
|
|
2914
2922
|
var isServiceUrlDisabled = isShowPopup || servicePopupVariant === 'edit';
|
|
2915
|
-
return jsx(
|
|
2923
|
+
return jsx(CustomDialog, {
|
|
2916
2924
|
open: isOpen,
|
|
2917
2925
|
hideBackdrop: hideBackdrop,
|
|
2918
2926
|
fullWidth: true,
|
|
2919
2927
|
maxWidth: "xs",
|
|
2920
2928
|
"data-testid": "servicePopup",
|
|
2929
|
+
title: getTitleForVariant(t, servicePopupVariant),
|
|
2921
2930
|
sx: {
|
|
2922
2931
|
'& .MuiDialog-paper': {
|
|
2923
2932
|
backgroundColor: "geowebColors.cards.cardContainer",
|
|
2924
2933
|
maxWidth: 458
|
|
2925
2934
|
}
|
|
2926
2935
|
},
|
|
2936
|
+
onClose: function onClose() {
|
|
2937
|
+
return closePopup && closePopup();
|
|
2938
|
+
},
|
|
2939
|
+
actions: isShowPopup ? jsx(Button, {
|
|
2940
|
+
onClick: function onClick() {
|
|
2941
|
+
return closePopup();
|
|
2942
|
+
},
|
|
2943
|
+
variant: "tertiary",
|
|
2944
|
+
sx: {
|
|
2945
|
+
width: {
|
|
2946
|
+
xs: '100%',
|
|
2947
|
+
sm: '117px'
|
|
2948
|
+
}
|
|
2949
|
+
},
|
|
2950
|
+
children: t('close')
|
|
2951
|
+
}) : jsxs(Fragment, {
|
|
2952
|
+
children: [jsx(Button, {
|
|
2953
|
+
onClick: closePopup,
|
|
2954
|
+
"data-testid": "closePopupButtonCancel",
|
|
2955
|
+
variant: "tertiary",
|
|
2956
|
+
sx: {
|
|
2957
|
+
width: {
|
|
2958
|
+
xs: '100%',
|
|
2959
|
+
sm: '117px'
|
|
2960
|
+
}
|
|
2961
|
+
},
|
|
2962
|
+
children: t('cancel')
|
|
2963
|
+
}), jsx(Button, {
|
|
2964
|
+
type: "submit",
|
|
2965
|
+
variant: "primary",
|
|
2966
|
+
form: "servicePopupForm",
|
|
2967
|
+
disabled: isSubmitDisabled || isLoading,
|
|
2968
|
+
"data-testid": "saveServiceButton",
|
|
2969
|
+
sx: {
|
|
2970
|
+
marginLeft: {
|
|
2971
|
+
xs: '0px!important',
|
|
2972
|
+
sm: '8px!important'
|
|
2973
|
+
},
|
|
2974
|
+
width: {
|
|
2975
|
+
xs: '100%',
|
|
2976
|
+
sm: '117px'
|
|
2977
|
+
}
|
|
2978
|
+
},
|
|
2979
|
+
children: t('save')
|
|
2980
|
+
})]
|
|
2981
|
+
}),
|
|
2927
2982
|
children: jsxs("form", {
|
|
2983
|
+
id: "servicePopupForm",
|
|
2928
2984
|
onSubmit: handleSubmit(function (formValues) {
|
|
2929
2985
|
return addNewService(formValues);
|
|
2930
2986
|
}),
|
|
2931
|
-
children: [
|
|
2987
|
+
children: [isLoading && jsx(Box, {
|
|
2932
2988
|
sx: {
|
|
2933
|
-
|
|
2934
|
-
padding: '16px 16px 24px 16px'
|
|
2989
|
+
position: 'relative'
|
|
2935
2990
|
},
|
|
2936
|
-
children:
|
|
2991
|
+
children: jsx(LinearProgress, {
|
|
2992
|
+
"data-testid": "loadingIndicator",
|
|
2993
|
+
color: "secondary",
|
|
2937
2994
|
sx: {
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
onClick: closePopup,
|
|
2956
|
-
"data-testid": "closePopupButtonCross",
|
|
2957
|
-
sx: {
|
|
2958
|
-
marginTop: 'auto',
|
|
2959
|
-
marginBottom: 'auto',
|
|
2960
|
-
'&.MuiButtonBase-root': {
|
|
2961
|
-
color: 'geowebColors.greys.accessible'
|
|
2962
|
-
}
|
|
2963
|
-
},
|
|
2964
|
-
children: jsx(Close, {})
|
|
2965
|
-
})]
|
|
2966
|
-
}), isLoading && jsx(Box, {
|
|
2967
|
-
sx: {
|
|
2968
|
-
position: 'relative'
|
|
2969
|
-
},
|
|
2970
|
-
children: jsx(LinearProgress, {
|
|
2971
|
-
"data-testid": "loadingIndicator",
|
|
2972
|
-
color: "secondary",
|
|
2973
|
-
sx: {
|
|
2974
|
-
position: 'absolute',
|
|
2975
|
-
width: '100%',
|
|
2976
|
-
top: 8
|
|
2977
|
-
}
|
|
2995
|
+
position: 'absolute',
|
|
2996
|
+
width: '100%',
|
|
2997
|
+
top: 8
|
|
2998
|
+
}
|
|
2999
|
+
})
|
|
3000
|
+
}), jsx(ReactHookFormTextField, {
|
|
3001
|
+
name: FormFields.serviceUrl,
|
|
3002
|
+
label: t('service-url-label'),
|
|
3003
|
+
onFocus: onFocusServiceUrl,
|
|
3004
|
+
autoFocus: !shouldDisableAutoFocus,
|
|
3005
|
+
onBlur: onBlurServiceUrl,
|
|
3006
|
+
onKeyDown: onKeyDownServiceUrl,
|
|
3007
|
+
sx: style.textField,
|
|
3008
|
+
rules: {
|
|
3009
|
+
required: true,
|
|
3010
|
+
validate: Object.assign({}, !isServiceUrlDisabled && {
|
|
3011
|
+
onValidateServiceUrl: onValidateServiceUrl
|
|
2978
3012
|
})
|
|
2979
|
-
})]
|
|
2980
|
-
}), jsxs(DialogContent, {
|
|
2981
|
-
sx: {
|
|
2982
|
-
padding: '8px 16px'
|
|
2983
3013
|
},
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
inputSlotProps: {
|
|
3001
|
-
disableUnderline: isShowPopup,
|
|
3002
|
-
endAdornment: isShowPopup && jsx(InputAdornment, {
|
|
3003
|
-
position: "end",
|
|
3004
|
-
children: jsx(CustomIconButton, {
|
|
3005
|
-
"aria-label": "copy url",
|
|
3006
|
-
onClick: function onClick() {
|
|
3007
|
-
void navigator.clipboard.writeText(serviceUrl);
|
|
3008
|
-
showSnackbar(t('copy-url-message'));
|
|
3009
|
-
},
|
|
3010
|
-
sx: {
|
|
3011
|
-
marginTop: 0.5
|
|
3012
|
-
},
|
|
3013
|
-
children: jsx(Copy, {})
|
|
3014
|
-
})
|
|
3014
|
+
disabled: isServiceUrlDisabled || isLoading,
|
|
3015
|
+
isReadOnly: isShowPopup,
|
|
3016
|
+
inputSlotProps: {
|
|
3017
|
+
disableUnderline: isShowPopup,
|
|
3018
|
+
endAdornment: isShowPopup && jsx(InputAdornment, {
|
|
3019
|
+
position: "end",
|
|
3020
|
+
children: jsx(CustomIconButton, {
|
|
3021
|
+
"aria-label": "copy url",
|
|
3022
|
+
onClick: function onClick() {
|
|
3023
|
+
void navigator.clipboard.writeText(serviceUrl);
|
|
3024
|
+
showSnackbar(t('copy-url-message'));
|
|
3025
|
+
},
|
|
3026
|
+
sx: {
|
|
3027
|
+
marginTop: 0.5
|
|
3028
|
+
},
|
|
3029
|
+
children: jsx(Copy, {})
|
|
3015
3030
|
})
|
|
3016
|
-
}
|
|
3017
|
-
defaultValue: serviceUrl
|
|
3018
|
-
}), jsx(ReactHookFormTextField, {
|
|
3019
|
-
name: FormFields.serviceName,
|
|
3020
|
-
label: t('service-name-label'),
|
|
3021
|
-
rules: {
|
|
3022
|
-
required: true,
|
|
3023
|
-
validate: {
|
|
3024
|
-
onValidateServiceName: onValidateServiceName
|
|
3025
|
-
}
|
|
3026
|
-
},
|
|
3027
|
-
disabled: isShowPopup || isLoading,
|
|
3028
|
-
isReadOnly: isShowPopup,
|
|
3029
|
-
inputSlotProps: {
|
|
3030
|
-
disableUnderline: isShowPopup
|
|
3031
|
-
},
|
|
3032
|
-
sx: style.textField,
|
|
3033
|
-
defaultValue: serviceName
|
|
3034
|
-
}), jsx(ReactHookFormTextField, {
|
|
3035
|
-
multiline: true,
|
|
3036
|
-
rows: 4,
|
|
3037
|
-
name: FormFields.serviceAbstracts,
|
|
3038
|
-
label: t('service-abstracts-label'),
|
|
3039
|
-
disabled: isShowPopup || isLoading,
|
|
3040
|
-
isReadOnly: isShowPopup,
|
|
3041
|
-
inputSlotProps: {
|
|
3042
|
-
disableUnderline: isShowPopup
|
|
3043
|
-
},
|
|
3044
|
-
helperText: !isShowPopup ? t('service-popup-helper-text') : '',
|
|
3045
|
-
sx: style.textField,
|
|
3046
|
-
defaultValue: ""
|
|
3047
|
-
}), !isServiceUrlDisabled && jsx(InitialValidationsTrigger, {
|
|
3048
|
-
trigger: trigger,
|
|
3049
|
-
getValues: getValues,
|
|
3050
|
-
onValidField: fetchServiceData
|
|
3051
|
-
})]
|
|
3052
|
-
}), jsx(DialogActions, {
|
|
3053
|
-
sx: {
|
|
3054
|
-
padding: 2
|
|
3031
|
+
})
|
|
3055
3032
|
},
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
}
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3033
|
+
defaultValue: serviceUrl
|
|
3034
|
+
}), jsx(ReactHookFormTextField, {
|
|
3035
|
+
name: FormFields.serviceName,
|
|
3036
|
+
label: t('service-name-label'),
|
|
3037
|
+
rules: {
|
|
3038
|
+
required: true,
|
|
3039
|
+
validate: {
|
|
3040
|
+
onValidateServiceName: onValidateServiceName
|
|
3041
|
+
}
|
|
3042
|
+
},
|
|
3043
|
+
disabled: isShowPopup || isLoading,
|
|
3044
|
+
isReadOnly: isShowPopup,
|
|
3045
|
+
inputSlotProps: {
|
|
3046
|
+
disableUnderline: isShowPopup
|
|
3047
|
+
},
|
|
3048
|
+
sx: style.textField,
|
|
3049
|
+
defaultValue: serviceName
|
|
3050
|
+
}), jsx(ReactHookFormTextField, {
|
|
3051
|
+
multiline: true,
|
|
3052
|
+
rows: 4,
|
|
3053
|
+
name: FormFields.serviceAbstracts,
|
|
3054
|
+
label: t('service-abstracts-label'),
|
|
3055
|
+
disabled: isShowPopup || isLoading,
|
|
3056
|
+
isReadOnly: isShowPopup,
|
|
3057
|
+
inputSlotProps: {
|
|
3058
|
+
disableUnderline: isShowPopup
|
|
3059
|
+
},
|
|
3060
|
+
helperText: !isShowPopup ? t('service-popup-helper-text') : '',
|
|
3061
|
+
sx: style.textField,
|
|
3062
|
+
defaultValue: ""
|
|
3063
|
+
}), !isServiceUrlDisabled && jsx(InitialValidationsTrigger, {
|
|
3064
|
+
trigger: trigger,
|
|
3065
|
+
getValues: getValues,
|
|
3066
|
+
onValidField: fetchServiceData
|
|
3086
3067
|
})]
|
|
3087
3068
|
})
|
|
3088
3069
|
});
|
|
@@ -3209,4 +3190,4 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
|
|
|
3209
3190
|
});
|
|
3210
3191
|
};
|
|
3211
3192
|
|
|
3212
|
-
export { AllChipConnect, KeywordFilterButtonConnect, KeywordFilterResults, KeywordFilterResultsConnect, KeywordFilterResultsListItemConnect, KeywordFilterSelectAllSwitchConnect, LAYER_SELECT_NAMESPACE, LayerAddRemoveButton, LayerList, LayerListConnect, LayerListDimensions, LayerListRow, LayerSelectButtonConnect, LayerSelectConnect, SearchFieldConnect, ServiceChip, ServiceChipConnect, ServiceList, ServiceListConnect, ServiceOptionsButton, ServiceOptionsDialog, ServiceOptionsDialogConnect, ServicePopup, ServicePopupConnect, ServicePopupDialogConnect, createMockStore,
|
|
3193
|
+
export { AllChipConnect, KeywordFilterButtonConnect, KeywordFilterResults, KeywordFilterResultsConnect, KeywordFilterResultsListItemConnect, KeywordFilterSelectAllSwitchConnect, LAYER_SELECT_NAMESPACE, LayerAddRemoveButton, LayerList, LayerListConnect, LayerListDimensions, LayerListRow, LayerSelectButtonConnect, LayerSelectConnect, SearchFieldConnect, ServiceChip, ServiceChipConnect, ServiceList, ServiceListConnect, ServiceOptionsButton, ServiceOptionsDialog, ServiceOptionsDialogConnect, ServicePopup, ServicePopupConnect, ServicePopupDialogConnect, createMockStore, getServiceSuccesUpdateMessage, getSuccesMessage, isUserAddedService, layerSelectActions, initialState as layerSelectInitialState, layerSelectListener, layerSelectMiddlewares, layerSelectReducer, layerSelectReducersMap, selectors as layerSelectSelectors, layerSelectTranslations, types as layerSelectTypes, useAppSelector };
|