@opengeoweb/workspace 9.19.1 → 9.20.1
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 +887 -935
- package/package.json +4 -4
package/index.esm.js
CHANGED
|
@@ -10,8 +10,7 @@ import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next
|
|
|
10
10
|
import { CORE_NAMESPACE, coreTranslations } from '@opengeoweb/core';
|
|
11
11
|
import { takeLatest, takeEvery, debounce, delay, put, all, select, call as call$g, takeLeading } from 'redux-saga/effects';
|
|
12
12
|
import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
13
|
-
import
|
|
14
|
-
import React__default, { useCallback } from 'react';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
14
|
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, Search, Clear, CloudLoading, CloudIdle, WebAssetOff } from '@opengeoweb/theme';
|
|
16
15
|
import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
|
|
17
16
|
import { timeSeriesModuleConfig } from '@opengeoweb/timeseries';
|
|
@@ -19,6 +18,8 @@ import { AuthenticationProvider, useAuthenticationContext } from '@opengeoweb/au
|
|
|
19
18
|
import { createStore } from '@redux-eggs/redux-toolkit';
|
|
20
19
|
import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
21
20
|
import { produce } from 'immer';
|
|
21
|
+
import * as React from 'react';
|
|
22
|
+
import React__default, { useCallback } from 'react';
|
|
22
23
|
import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, useTheme, Chip, Stack, debounce as debounce$1, TextField, InputAdornment, Box, Backdrop, Menu, ListSubheader, MenuItem, Tabs } from '@mui/material';
|
|
23
24
|
import 'react-mosaic-component/react-mosaic-component.css';
|
|
24
25
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
@@ -597,7 +598,9 @@ var store$4 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
|
|
|
597
598
|
source: 'https://github.com/zloirock/core-js'
|
|
598
599
|
});
|
|
599
600
|
|
|
600
|
-
var
|
|
601
|
+
var sharedStoreExports = sharedStore.exports;
|
|
602
|
+
|
|
603
|
+
var store$3 = sharedStoreExports;
|
|
601
604
|
|
|
602
605
|
var shared$4 = function (key, value) {
|
|
603
606
|
return store$3[key] || (store$3[key] = value || {});
|
|
@@ -839,7 +842,7 @@ var functionName = {
|
|
|
839
842
|
|
|
840
843
|
var uncurryThis$i = functionUncurryThis;
|
|
841
844
|
var isCallable$c = isCallable$i;
|
|
842
|
-
var store$2 =
|
|
845
|
+
var store$2 = sharedStoreExports;
|
|
843
846
|
|
|
844
847
|
var functionToString = uncurryThis$i(Function.toString);
|
|
845
848
|
|
|
@@ -875,7 +878,7 @@ var global$8 = global$g;
|
|
|
875
878
|
var isObject$7 = isObject$c;
|
|
876
879
|
var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
|
|
877
880
|
var hasOwn$7 = hasOwnProperty_1;
|
|
878
|
-
var shared$1 =
|
|
881
|
+
var shared$1 = sharedStoreExports;
|
|
879
882
|
var sharedKey$2 = sharedKey$3;
|
|
880
883
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
881
884
|
|
|
@@ -996,9 +999,11 @@ Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
|
996
999
|
return isCallable$a(this) && getInternalState$2(this).source || inspectSource$1(this);
|
|
997
1000
|
}, 'toString');
|
|
998
1001
|
|
|
1002
|
+
var makeBuiltInExports = makeBuiltIn$2.exports;
|
|
1003
|
+
|
|
999
1004
|
var isCallable$9 = isCallable$i;
|
|
1000
1005
|
var definePropertyModule$2 = objectDefineProperty;
|
|
1001
|
-
var makeBuiltIn =
|
|
1006
|
+
var makeBuiltIn = makeBuiltInExports;
|
|
1002
1007
|
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
1003
1008
|
|
|
1004
1009
|
var defineBuiltIn$5 = function (O, key, value, options) {
|
|
@@ -4217,20 +4222,20 @@ const getViewPresetToSendToBackend = createSelector(getViewById, mapSelectors.ge
|
|
|
4217
4222
|
|
|
4218
4223
|
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
4219
4224
|
__proto__: null,
|
|
4220
|
-
getWorkspaceState: getWorkspaceState,
|
|
4221
4225
|
getInitialViewMapPreset: getInitialViewMapPreset,
|
|
4222
4226
|
getMosaicNode: getMosaicNode,
|
|
4227
|
+
getSelectedWorkspaceScope: getSelectedWorkspaceScope,
|
|
4228
|
+
getSelectedWorkspaceTitle: getSelectedWorkspaceTitle,
|
|
4229
|
+
getShouldPreventClose: getShouldPreventClose,
|
|
4223
4230
|
getViewById: getViewById,
|
|
4224
4231
|
getViewIds: getViewIds,
|
|
4225
|
-
|
|
4226
|
-
isWorkspaceLoading: isWorkspaceLoading,
|
|
4227
|
-
getWorkspaceError: getWorkspaceError,
|
|
4228
|
-
getSelectedWorkspaceTitle: getSelectedWorkspaceTitle,
|
|
4229
|
-
hasWorkspaceChanges: hasWorkspaceChanges,
|
|
4232
|
+
getViewPresetToSendToBackend: getViewPresetToSendToBackend,
|
|
4230
4233
|
getViewType: getViewType,
|
|
4231
|
-
getSelectedWorkspaceScope: getSelectedWorkspaceScope,
|
|
4232
4234
|
getWorkspaceData: getWorkspaceData,
|
|
4233
|
-
|
|
4235
|
+
getWorkspaceError: getWorkspaceError,
|
|
4236
|
+
getWorkspaceState: getWorkspaceState,
|
|
4237
|
+
hasWorkspaceChanges: hasWorkspaceChanges,
|
|
4238
|
+
isWorkspaceLoading: isWorkspaceLoading
|
|
4234
4239
|
});
|
|
4235
4240
|
|
|
4236
4241
|
/* *
|
|
@@ -7734,6 +7739,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
7734
7739
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7735
7740
|
PERFORMANCE OF THIS SOFTWARE.
|
|
7736
7741
|
***************************************************************************** */
|
|
7742
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
7743
|
+
|
|
7737
7744
|
|
|
7738
7745
|
function __rest(s, e) {
|
|
7739
7746
|
var t = {};
|
|
@@ -7763,6 +7770,22 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
7763
7770
|
};
|
|
7764
7771
|
|
|
7765
7772
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
7773
|
+
/* *
|
|
7774
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7775
|
+
* you may not use this file except in compliance with the License.
|
|
7776
|
+
* You may obtain a copy of the License at
|
|
7777
|
+
*
|
|
7778
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7779
|
+
*
|
|
7780
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7781
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7782
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7783
|
+
* See the License for the specific language governing permissions and
|
|
7784
|
+
* limitations under the License.
|
|
7785
|
+
*
|
|
7786
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7787
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
7788
|
+
* */
|
|
7766
7789
|
const devToolsStateSanitizer = {
|
|
7767
7790
|
stateSanitizer: state => {
|
|
7768
7791
|
return produce(state, draftState => {
|
|
@@ -7795,18 +7818,24 @@ const store = createStore({
|
|
|
7795
7818
|
const WorkspaceThemeProvider = ({
|
|
7796
7819
|
children,
|
|
7797
7820
|
theme: _theme = lightTheme
|
|
7798
|
-
}) =>
|
|
7821
|
+
}) => jsx(ThemeWrapper, Object.assign({
|
|
7799
7822
|
theme: _theme
|
|
7800
|
-
},
|
|
7823
|
+
}, {
|
|
7824
|
+
children: children
|
|
7825
|
+
}));
|
|
7801
7826
|
const WorkspaceWrapperProvider = withEggs([...coreModuleConfig, timeSeriesModuleConfig, workspaceModuleConfig])(({
|
|
7802
7827
|
theme,
|
|
7803
7828
|
children
|
|
7804
|
-
}) => (
|
|
7829
|
+
}) => jsx(WorkspaceThemeProvider, Object.assign({
|
|
7805
7830
|
theme: theme
|
|
7806
|
-
},
|
|
7831
|
+
}, {
|
|
7832
|
+
children: children
|
|
7833
|
+
})));
|
|
7807
7834
|
const DemoWrapper = _a => {
|
|
7808
7835
|
var props = __rest(_a, []);
|
|
7809
|
-
return
|
|
7836
|
+
return jsx(WorkspaceI18nProvider, {
|
|
7837
|
+
children: jsx(WorkspaceThemeProvider, Object.assign({}, props))
|
|
7838
|
+
});
|
|
7810
7839
|
};
|
|
7811
7840
|
const defaultAuthConfig = {
|
|
7812
7841
|
isLoggedIn: true,
|
|
@@ -7825,53 +7854,55 @@ const WorkspaceWrapperProviderWithStore = ({
|
|
|
7825
7854
|
createApi: _createApi = createApi,
|
|
7826
7855
|
theme,
|
|
7827
7856
|
auth: _auth = defaultAuthConfig
|
|
7828
|
-
}) => (
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
},
|
|
7836
|
-
|
|
7837
|
-
|
|
7857
|
+
}) => jsx(WorkspaceI18nProvider, {
|
|
7858
|
+
children: jsx(AuthenticationProvider, Object.assign({
|
|
7859
|
+
value: _auth
|
|
7860
|
+
}, {
|
|
7861
|
+
children: jsx(ApiProvider, Object.assign({
|
|
7862
|
+
createApi: _createApi,
|
|
7863
|
+
name: API_NAME
|
|
7864
|
+
}, {
|
|
7865
|
+
children: jsx(Provider, Object.assign({
|
|
7866
|
+
store: _store
|
|
7867
|
+
}, {
|
|
7868
|
+
children: jsx(WorkspaceWrapperProvider, Object.assign({
|
|
7869
|
+
theme: theme
|
|
7870
|
+
}, {
|
|
7871
|
+
children: jsx(SnackbarWrapperConnect, {
|
|
7872
|
+
children: jsx(ConfirmationServiceProvider, {
|
|
7873
|
+
children: children
|
|
7874
|
+
})
|
|
7875
|
+
})
|
|
7876
|
+
}))
|
|
7877
|
+
}))
|
|
7878
|
+
}))
|
|
7879
|
+
}))
|
|
7880
|
+
});
|
|
7838
7881
|
const WorkspaceI18nProvider = ({
|
|
7839
7882
|
children
|
|
7840
7883
|
}) => {
|
|
7841
|
-
return
|
|
7884
|
+
return jsx(I18nextProvider, Object.assign({
|
|
7842
7885
|
i18n: i18n
|
|
7843
|
-
},
|
|
7886
|
+
}, {
|
|
7887
|
+
children: children
|
|
7888
|
+
}));
|
|
7844
7889
|
};
|
|
7845
7890
|
|
|
7846
|
-
/* *
|
|
7847
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7848
|
-
* you may not use this file except in compliance with the License.
|
|
7849
|
-
* You may obtain a copy of the License at
|
|
7850
|
-
*
|
|
7851
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7852
|
-
*
|
|
7853
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
7854
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7855
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7856
|
-
* See the License for the specific language governing permissions and
|
|
7857
|
-
* limitations under the License.
|
|
7858
|
-
*
|
|
7859
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7860
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
7861
|
-
* */
|
|
7862
7891
|
const WorkspaceModuleProvider = ({
|
|
7863
7892
|
config,
|
|
7864
7893
|
auth,
|
|
7865
7894
|
onSetAuth,
|
|
7866
7895
|
children
|
|
7867
7896
|
}) => {
|
|
7868
|
-
return
|
|
7897
|
+
return jsx(ApiProvider, Object.assign({
|
|
7869
7898
|
auth: auth,
|
|
7870
7899
|
onSetAuth: onSetAuth,
|
|
7871
7900
|
createApi: config.baseURL ? createApi$1 : createApi,
|
|
7872
7901
|
config: config,
|
|
7873
7902
|
name: API_NAME
|
|
7874
|
-
},
|
|
7903
|
+
}, {
|
|
7904
|
+
children: children
|
|
7905
|
+
}));
|
|
7875
7906
|
};
|
|
7876
7907
|
|
|
7877
7908
|
// takes a component and connects module methods with workspace store
|
|
@@ -7890,7 +7921,7 @@ const ComponentsLookUpWrapper = _a => {
|
|
|
7890
7921
|
shouldPreventClose
|
|
7891
7922
|
}));
|
|
7892
7923
|
}, [dispatch, viewId]);
|
|
7893
|
-
return
|
|
7924
|
+
return jsx(RenderComponent, Object.assign({
|
|
7894
7925
|
onPreventCloseView: togglePreventClose
|
|
7895
7926
|
}, props));
|
|
7896
7927
|
};
|
|
@@ -8055,93 +8086,93 @@ const WorkspaceControls = ({
|
|
|
8055
8086
|
actions.remove(path);
|
|
8056
8087
|
}
|
|
8057
8088
|
});
|
|
8058
|
-
return
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8089
|
+
return jsxs(Fragment, {
|
|
8090
|
+
children: [jsx(CustomIconButton, Object.assign({
|
|
8091
|
+
"data-testid": "split-horizontal-btn",
|
|
8092
|
+
sx: buttonStyle,
|
|
8093
|
+
onClick: () => {
|
|
8094
|
+
const newNode = createNode();
|
|
8095
|
+
const previousNode = getAndAssertNodeAtPathExists(actions.getRoot(), path);
|
|
8096
|
+
actions.replaceWith(path, {
|
|
8097
|
+
direction: 'column',
|
|
8098
|
+
first: previousNode,
|
|
8099
|
+
second: newNode
|
|
8100
|
+
});
|
|
8101
|
+
},
|
|
8102
|
+
tooltipTitle: t('workspace-control-split-horizontal')
|
|
8103
|
+
}, {
|
|
8104
|
+
children: jsx(SplitVertical, {})
|
|
8105
|
+
})), jsx(CustomIconButton, Object.assign({
|
|
8106
|
+
"data-testid": "split-vertical-btn",
|
|
8107
|
+
sx: buttonStyle,
|
|
8108
|
+
onClick: () => {
|
|
8109
|
+
const newNode = createNode();
|
|
8110
|
+
const previousNode = getAndAssertNodeAtPathExists(actions.getRoot(), path);
|
|
8111
|
+
actions.replaceWith(path, {
|
|
8112
|
+
direction: 'row',
|
|
8113
|
+
first: previousNode,
|
|
8114
|
+
second: newNode
|
|
8115
|
+
});
|
|
8116
|
+
},
|
|
8117
|
+
tooltipTitle: t('workspace-control-split-vertical')
|
|
8118
|
+
}, {
|
|
8119
|
+
children: jsx(SplitHorizontal, {})
|
|
8120
|
+
})), !enableUnexpand || isString(mosaicNode) ? jsx(CustomIconButton, Object.assign({
|
|
8121
|
+
"data-testid": "expand-btn",
|
|
8122
|
+
sx: buttonStyle,
|
|
8123
|
+
onClick: () => {
|
|
8124
|
+
setStateBeforeExpand(mosaicNode);
|
|
8125
|
+
setEnableUnexpand(true);
|
|
8126
|
+
actions.expand(path, 70);
|
|
8127
|
+
},
|
|
8128
|
+
tooltipTitle: t('workspace-control-expand')
|
|
8129
|
+
}, {
|
|
8130
|
+
children: jsx(Expand, {})
|
|
8131
|
+
})) : jsx(CustomIconButton, Object.assign({
|
|
8132
|
+
"data-testid": "unexpand-btn",
|
|
8133
|
+
sx: buttonStyle,
|
|
8134
|
+
onClick: () => {
|
|
8135
|
+
const stateBeforeExpandCopy = isString(stateBeforeExpand) ? stateBeforeExpand : Object.assign({}, stateBeforeExpand);
|
|
8136
|
+
actions.replaceWith([], stateBeforeExpandCopy);
|
|
8137
|
+
},
|
|
8138
|
+
tooltipTitle: t('workspace-control-unexpand')
|
|
8139
|
+
}, {
|
|
8140
|
+
children: jsx(UnExpand, {})
|
|
8141
|
+
})), jsx(CustomIconButton, Object.assign({
|
|
8142
|
+
"data-testid": "close-btn",
|
|
8143
|
+
sx: buttonStyle,
|
|
8144
|
+
onClick: onClose,
|
|
8145
|
+
tooltipTitle: t('workspace-control-close'),
|
|
8146
|
+
id: "close-window-button"
|
|
8147
|
+
}, {
|
|
8148
|
+
children: jsx(Close, {})
|
|
8149
|
+
}))]
|
|
8150
|
+
});
|
|
8108
8151
|
};
|
|
8109
8152
|
|
|
8110
|
-
/* *
|
|
8111
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8112
|
-
* you may not use this file except in compliance with the License.
|
|
8113
|
-
* You may obtain a copy of the License at
|
|
8114
|
-
*
|
|
8115
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8116
|
-
*
|
|
8117
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8118
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8119
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8120
|
-
* See the License for the specific language governing permissions and
|
|
8121
|
-
* limitations under the License.
|
|
8122
|
-
*
|
|
8123
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8124
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8125
|
-
* */
|
|
8126
8153
|
const ViewLoading = ({
|
|
8127
8154
|
viewPresetId
|
|
8128
8155
|
}) => {
|
|
8129
8156
|
const {
|
|
8130
8157
|
t
|
|
8131
8158
|
} = useWorkspaceTranslation();
|
|
8132
|
-
return
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8159
|
+
return jsxs(Fragment, {
|
|
8160
|
+
children: [jsx(LinearProgress, {
|
|
8161
|
+
"data-testid": "loading-bar",
|
|
8162
|
+
color: "secondary",
|
|
8163
|
+
sx: {
|
|
8164
|
+
position: 'absolute',
|
|
8165
|
+
width: '100%',
|
|
8166
|
+
top: 0
|
|
8167
|
+
}
|
|
8168
|
+
}), jsxs(Typography, Object.assign({
|
|
8169
|
+
sx: {
|
|
8170
|
+
margin: 1
|
|
8171
|
+
}
|
|
8172
|
+
}, {
|
|
8173
|
+
children: [t('workspace-loading'), " ", viewPresetId]
|
|
8174
|
+
}))]
|
|
8175
|
+
});
|
|
8145
8176
|
};
|
|
8146
8177
|
const ViewError = ({
|
|
8147
8178
|
viewPresetId,
|
|
@@ -8157,7 +8188,7 @@ const ViewError = ({
|
|
|
8157
8188
|
mosaicNodeId
|
|
8158
8189
|
}));
|
|
8159
8190
|
}, [dispatch, viewPresetId, mosaicNodeId]);
|
|
8160
|
-
return
|
|
8191
|
+
return jsx(AlertBanner, {
|
|
8161
8192
|
title: t('workspace-viewpresets-fail-fetch', {
|
|
8162
8193
|
VIEWPRESET_ID: viewPresetId
|
|
8163
8194
|
}),
|
|
@@ -8175,11 +8206,11 @@ const defaultComponentsLookUp = ({
|
|
|
8175
8206
|
}) => {
|
|
8176
8207
|
switch (componentType) {
|
|
8177
8208
|
case 'ViewLoading':
|
|
8178
|
-
return
|
|
8209
|
+
return jsx(ViewLoading, {
|
|
8179
8210
|
viewPresetId: viewPresetId
|
|
8180
8211
|
});
|
|
8181
8212
|
case 'ViewError':
|
|
8182
|
-
return
|
|
8213
|
+
return jsx(ViewError, {
|
|
8183
8214
|
viewPresetId: viewPresetId,
|
|
8184
8215
|
mosaicNodeId: mosaicNodeId
|
|
8185
8216
|
});
|
|
@@ -8263,16 +8294,16 @@ const WORKSPACE_SELECT_LIST_ROW_HEIGHT = 46;
|
|
|
8263
8294
|
const getPresetIcon = preset => {
|
|
8264
8295
|
switch (preset.viewType) {
|
|
8265
8296
|
case 'tiledWindow':
|
|
8266
|
-
return
|
|
8297
|
+
return jsx(PresetTiles, {
|
|
8267
8298
|
"data-testid": "tiledWindowIcon"
|
|
8268
8299
|
});
|
|
8269
8300
|
case 'multiWindow':
|
|
8270
|
-
return
|
|
8301
|
+
return jsx(PresetWorkspace, {
|
|
8271
8302
|
"data-testid": "multiWindowIcon"
|
|
8272
8303
|
});
|
|
8273
8304
|
case 'singleWindow':
|
|
8274
8305
|
default:
|
|
8275
|
-
return
|
|
8306
|
+
return jsx(Preset, {
|
|
8276
8307
|
"data-testid": "singleWindowIcon"
|
|
8277
8308
|
});
|
|
8278
8309
|
}
|
|
@@ -8304,7 +8335,7 @@ const WorkspaceSelectListRow = ({
|
|
|
8304
8335
|
text: t(editTitle),
|
|
8305
8336
|
action: onEdit
|
|
8306
8337
|
}] : [])];
|
|
8307
|
-
return
|
|
8338
|
+
return jsx(ListItem, Object.assign({
|
|
8308
8339
|
disablePadding: true,
|
|
8309
8340
|
sx: {
|
|
8310
8341
|
marginBottom: 0.5,
|
|
@@ -8325,75 +8356,73 @@ const WorkspaceSelectListRow = ({
|
|
|
8325
8356
|
color: 'geowebColors.typographyAndIcons.text'
|
|
8326
8357
|
}
|
|
8327
8358
|
}
|
|
8328
|
-
},
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8359
|
+
}, {
|
|
8360
|
+
children: jsxs(ListItemButton, Object.assign({
|
|
8361
|
+
"data-testid": `${_testIdPrefix}-selectListRow`,
|
|
8362
|
+
selected: isSelected,
|
|
8363
|
+
onClick: () => {
|
|
8364
|
+
onClickPreset(workspacePreset.id);
|
|
8365
|
+
},
|
|
8366
|
+
sx: {
|
|
8367
|
+
padding: 1,
|
|
8368
|
+
height: `${WORKSPACE_SELECT_LIST_ROW_HEIGHT}px`
|
|
8369
|
+
},
|
|
8370
|
+
role: "listitem",
|
|
8371
|
+
"aria-label": _testIdPrefix
|
|
8372
|
+
}, {
|
|
8373
|
+
children: [jsx(ListItemIcon, {
|
|
8374
|
+
children: getPresetIcon(workspacePreset)
|
|
8375
|
+
}), jsx(CustomTooltip, Object.assign({
|
|
8376
|
+
title: workspacePreset.title
|
|
8377
|
+
}, {
|
|
8378
|
+
children: jsx(ListItemText, {
|
|
8379
|
+
primary: jsx(SearchHighlight, {
|
|
8380
|
+
text: workspacePreset === null || workspacePreset === void 0 ? void 0 : workspacePreset.title,
|
|
8381
|
+
search: _searchQuery
|
|
8382
|
+
}),
|
|
8383
|
+
secondary: jsx(SearchHighlight, {
|
|
8384
|
+
text: workspacePreset === null || workspacePreset === void 0 ? void 0 : workspacePreset.abstract,
|
|
8385
|
+
search: _searchQuery
|
|
8386
|
+
}),
|
|
8387
|
+
sx: {
|
|
8388
|
+
margin: 0
|
|
8389
|
+
}
|
|
8390
|
+
})
|
|
8391
|
+
})), _isEditable && jsx(Grid, Object.assign({
|
|
8392
|
+
sx: {
|
|
8393
|
+
minWidth: 56,
|
|
8394
|
+
marginLeft: 2
|
|
8395
|
+
}
|
|
8396
|
+
}, {
|
|
8397
|
+
children: jsxs(Grid, Object.assign({
|
|
8398
|
+
item: true
|
|
8399
|
+
}, {
|
|
8400
|
+
children: [jsx(ToggleMenu, {
|
|
8401
|
+
buttonTestId: `${_testIdPrefix}-listOptionsButton`,
|
|
8402
|
+
menuPosition: "right",
|
|
8403
|
+
menuItems: menuItems,
|
|
8404
|
+
menuTitle: t('workspace-options'),
|
|
8405
|
+
isDefaultOpen: _isOptionsMenuOpen
|
|
8406
|
+
}), workspacePreset.scope === 'user' && jsx(CustomIconButton, Object.assign({
|
|
8407
|
+
tooltipTitle: t('workspace-delete-tooltip'),
|
|
8408
|
+
onClick: event => {
|
|
8409
|
+
event.stopPropagation();
|
|
8410
|
+
onClickWorkspacePresetOption(workspacePreset.id, WorkspacePresetAction.DELETE, workspacePreset);
|
|
8411
|
+
},
|
|
8412
|
+
variant: "tool",
|
|
8413
|
+
sx: {
|
|
8414
|
+
marginLeft: 1
|
|
8415
|
+
},
|
|
8416
|
+
"data-testid": `${_testIdPrefix}-listDeleteButton`
|
|
8417
|
+
}, {
|
|
8418
|
+
children: jsx(Delete, {})
|
|
8419
|
+
}))]
|
|
8420
|
+
}))
|
|
8421
|
+
}))]
|
|
8422
|
+
}))
|
|
8423
|
+
}));
|
|
8379
8424
|
};
|
|
8380
8425
|
|
|
8381
|
-
/* *
|
|
8382
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8383
|
-
* you may not use this file except in compliance with the License.
|
|
8384
|
-
* You may obtain a copy of the License at
|
|
8385
|
-
*
|
|
8386
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8387
|
-
*
|
|
8388
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8389
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8390
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8391
|
-
* See the License for the specific language governing permissions and
|
|
8392
|
-
* limitations under the License.
|
|
8393
|
-
*
|
|
8394
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8395
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8396
|
-
* */
|
|
8397
8426
|
const FilterChip = ({
|
|
8398
8427
|
label,
|
|
8399
8428
|
id,
|
|
@@ -8402,7 +8431,7 @@ const FilterChip = ({
|
|
|
8402
8431
|
handleClick: _handleClick = () => {}
|
|
8403
8432
|
}) => {
|
|
8404
8433
|
const theme = useTheme();
|
|
8405
|
-
return
|
|
8434
|
+
return jsx(Chip, {
|
|
8406
8435
|
size: "small",
|
|
8407
8436
|
id: id,
|
|
8408
8437
|
label: label,
|
|
@@ -8417,22 +8446,6 @@ const FilterChip = ({
|
|
|
8417
8446
|
});
|
|
8418
8447
|
};
|
|
8419
8448
|
|
|
8420
|
-
/* *
|
|
8421
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8422
|
-
* you may not use this file except in compliance with the License.
|
|
8423
|
-
* You may obtain a copy of the License at
|
|
8424
|
-
*
|
|
8425
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8426
|
-
*
|
|
8427
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8428
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8429
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8430
|
-
* See the License for the specific language governing permissions and
|
|
8431
|
-
* limitations under the License.
|
|
8432
|
-
*
|
|
8433
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8434
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8435
|
-
* */
|
|
8436
8449
|
const FilterList = ({
|
|
8437
8450
|
filters: _filters = workspaceListFilterOptions,
|
|
8438
8451
|
onChipClick: _onChipClick = () => {},
|
|
@@ -8441,47 +8454,52 @@ const FilterList = ({
|
|
|
8441
8454
|
const {
|
|
8442
8455
|
t
|
|
8443
8456
|
} = useWorkspaceTranslation();
|
|
8444
|
-
return
|
|
8457
|
+
return jsxs(Stack, Object.assign({
|
|
8445
8458
|
direction: "row",
|
|
8446
8459
|
spacing: 1,
|
|
8447
8460
|
"data-testid": "filterList"
|
|
8448
|
-
},
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8461
|
+
}, {
|
|
8462
|
+
children: [jsx(FilterChip, {
|
|
8463
|
+
id: "all",
|
|
8464
|
+
label: t('workspace-all-button'),
|
|
8465
|
+
isSelected: _isAllSelected,
|
|
8466
|
+
handleClick: key => _onChipClick(key, !_isAllSelected)
|
|
8467
|
+
}), _filters.map(filter => {
|
|
8468
|
+
return jsx(FilterChip, {
|
|
8469
|
+
id: filter.id,
|
|
8470
|
+
label: t(filter.label),
|
|
8471
|
+
isSelected: _isAllSelected ? false : filter.isSelected,
|
|
8472
|
+
isDisabled: filter.isDisabled,
|
|
8473
|
+
handleClick: key => {
|
|
8474
|
+
// If they are all isSelected ensure that if one is clicked that one will be the only one set to selected
|
|
8475
|
+
const selected = _isAllSelected ? true : !filter.isSelected;
|
|
8476
|
+
_onChipClick(key, selected);
|
|
8477
|
+
}
|
|
8478
|
+
}, filter.id);
|
|
8479
|
+
})]
|
|
8466
8480
|
}));
|
|
8467
8481
|
};
|
|
8468
8482
|
|
|
8469
8483
|
const DEBOUNCE_TIMEOUT = 300;
|
|
8470
8484
|
const SearchButton = ({
|
|
8471
8485
|
label
|
|
8472
|
-
}) => (
|
|
8486
|
+
}) => jsx(CustomIconButton, Object.assign({
|
|
8473
8487
|
tooltipTitle: label,
|
|
8474
8488
|
edge: "end",
|
|
8475
8489
|
size: "large"
|
|
8476
|
-
},
|
|
8490
|
+
}, {
|
|
8491
|
+
children: jsx(Search, {})
|
|
8492
|
+
}));
|
|
8477
8493
|
const ClearButton = ({
|
|
8478
8494
|
onClick
|
|
8479
|
-
}) => (
|
|
8495
|
+
}) => jsx(CustomIconButton, Object.assign({
|
|
8480
8496
|
tooltipTitle: "Clear",
|
|
8481
8497
|
edge: "end",
|
|
8482
8498
|
onClick: onClick,
|
|
8483
8499
|
size: "large"
|
|
8484
|
-
},
|
|
8500
|
+
}, {
|
|
8501
|
+
children: jsx(Clear, {})
|
|
8502
|
+
}));
|
|
8485
8503
|
const SearchField = ({
|
|
8486
8504
|
valueChanged,
|
|
8487
8505
|
value: _value = ''
|
|
@@ -8493,7 +8511,7 @@ const SearchField = ({
|
|
|
8493
8511
|
const label = t('workspace-search');
|
|
8494
8512
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8495
8513
|
const handleValueChangeDebounced = React.useCallback(debounce$1(valueChanged, DEBOUNCE_TIMEOUT), []);
|
|
8496
|
-
return
|
|
8514
|
+
return jsx(TextField, {
|
|
8497
8515
|
variant: "filled",
|
|
8498
8516
|
size: "small",
|
|
8499
8517
|
sx: {
|
|
@@ -8510,36 +8528,22 @@ const SearchField = ({
|
|
|
8510
8528
|
setLocalValue(e.target.value);
|
|
8511
8529
|
},
|
|
8512
8530
|
InputProps: {
|
|
8513
|
-
endAdornment: (
|
|
8531
|
+
endAdornment: jsx(InputAdornment, Object.assign({
|
|
8514
8532
|
position: "end"
|
|
8515
|
-
},
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8533
|
+
}, {
|
|
8534
|
+
children: localValue ? jsx(ClearButton, {
|
|
8535
|
+
onClick: () => {
|
|
8536
|
+
setLocalValue('');
|
|
8537
|
+
valueChanged('');
|
|
8538
|
+
}
|
|
8539
|
+
}) : jsx(SearchButton, {
|
|
8540
|
+
label: label
|
|
8541
|
+
})
|
|
8542
|
+
}))
|
|
8523
8543
|
}
|
|
8524
8544
|
});
|
|
8525
8545
|
};
|
|
8526
8546
|
|
|
8527
|
-
/* *
|
|
8528
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8529
|
-
* you may not use this file except in compliance with the License.
|
|
8530
|
-
* You may obtain a copy of the License at
|
|
8531
|
-
*
|
|
8532
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8533
|
-
*
|
|
8534
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8535
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8536
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8537
|
-
* See the License for the specific language governing permissions and
|
|
8538
|
-
* limitations under the License.
|
|
8539
|
-
*
|
|
8540
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8541
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8542
|
-
* */
|
|
8543
8547
|
const DEFAULT_FILTER_HEIGHT = 85;
|
|
8544
8548
|
const WorkspaceFilter = ({
|
|
8545
8549
|
filters,
|
|
@@ -8548,20 +8552,24 @@ const WorkspaceFilter = ({
|
|
|
8548
8552
|
isAllSelected,
|
|
8549
8553
|
searchQuery
|
|
8550
8554
|
}) => {
|
|
8551
|
-
return
|
|
8555
|
+
return jsx(Box, Object.assign({
|
|
8552
8556
|
sx: {
|
|
8553
8557
|
marginBottom: '8px'
|
|
8554
8558
|
}
|
|
8555
|
-
},
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8559
|
+
}, {
|
|
8560
|
+
children: jsxs(Stack, Object.assign({
|
|
8561
|
+
spacing: 1
|
|
8562
|
+
}, {
|
|
8563
|
+
children: [jsx(SearchField, {
|
|
8564
|
+
value: searchQuery,
|
|
8565
|
+
valueChanged: _onSearch
|
|
8566
|
+
}), jsx(FilterList, {
|
|
8567
|
+
filters: filters,
|
|
8568
|
+
onChipClick: _onClickFilterChip,
|
|
8569
|
+
isAllSelected: isAllSelected
|
|
8570
|
+
})]
|
|
8571
|
+
}))
|
|
8572
|
+
}));
|
|
8565
8573
|
};
|
|
8566
8574
|
|
|
8567
8575
|
const MIN_HEIGHT_SCROLLABLE_LIST = 88; // Slightly less than 2 rows
|
|
@@ -8584,47 +8592,58 @@ const WorkspaceSelectList = ({
|
|
|
8584
8592
|
t
|
|
8585
8593
|
} = useWorkspaceTranslation();
|
|
8586
8594
|
const items = React.useMemo(() => !hideNewWorkspace ? [_newPreset, ...workspacePresets] : workspacePresets, [hideNewWorkspace, _newPreset, workspacePresets]);
|
|
8587
|
-
return
|
|
8595
|
+
return jsxs(Box, Object.assign({
|
|
8588
8596
|
"data-testid": `${_testIdPrefix}-selectList`,
|
|
8589
8597
|
sx: {
|
|
8590
8598
|
height: `calc(100% - ${DEFAULT_FILTER_HEIGHT}px)`,
|
|
8591
8599
|
minHeight: MIN_HEIGHT_SCROLLABLE_LIST
|
|
8592
8600
|
}
|
|
8593
|
-
},
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8601
|
+
}, {
|
|
8602
|
+
children: [jsxs(Box, Object.assign({
|
|
8603
|
+
sx: {
|
|
8604
|
+
marginBottom: '4px',
|
|
8605
|
+
fontSize: '12px'
|
|
8606
|
+
}
|
|
8607
|
+
}, {
|
|
8608
|
+
children: [workspacePresets.length, " ", t('workspace-results')]
|
|
8609
|
+
})), jsx(AutoSizer, {
|
|
8610
|
+
children: ({
|
|
8611
|
+
height: _height = 0,
|
|
8612
|
+
width: _width = 0
|
|
8613
|
+
}) => jsx(Box, Object.assign({
|
|
8614
|
+
sx: {
|
|
8615
|
+
paddingTop: `${LIST_PADDING_TOP}px`
|
|
8616
|
+
}
|
|
8617
|
+
}, {
|
|
8618
|
+
children: jsx(FixedSizeList, Object.assign({
|
|
8619
|
+
height: _height - DEFAULT_RESULTS_HEIGHT,
|
|
8620
|
+
width: _width,
|
|
8621
|
+
itemCount: items.length,
|
|
8622
|
+
itemSize: rowHeight
|
|
8623
|
+
}, {
|
|
8624
|
+
children: ({
|
|
8625
|
+
index,
|
|
8626
|
+
style
|
|
8627
|
+
}) => {
|
|
8628
|
+
const preset = items[index];
|
|
8629
|
+
return jsx("div", Object.assign({
|
|
8630
|
+
style: style
|
|
8631
|
+
}, {
|
|
8632
|
+
children: jsx(WorkspaceSelectListRow, {
|
|
8633
|
+
workspacePreset: preset,
|
|
8634
|
+
onClickPreset: onClickPreset,
|
|
8635
|
+
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
8636
|
+
isEditable: isLoggedIn,
|
|
8637
|
+
searchQuery: searchQuery,
|
|
8638
|
+
isSelected: currentSelectedId === preset.id || currentSelectedId === '' && preset.id === undefined,
|
|
8639
|
+
testIdPrefix: _testIdPrefix
|
|
8640
|
+
})
|
|
8641
|
+
}), preset.id || 'emptyPreset');
|
|
8642
|
+
}
|
|
8643
|
+
}))
|
|
8644
|
+
}))
|
|
8645
|
+
})]
|
|
8646
|
+
}));
|
|
8628
8647
|
};
|
|
8629
8648
|
|
|
8630
8649
|
const ViewPresetMenuListConnect = ({
|
|
@@ -8754,70 +8773,58 @@ const ViewPresetMenuListConnect = ({
|
|
|
8754
8773
|
};
|
|
8755
8774
|
const isAllSelectedForFilters = viewPresetListFilters.every(filter => filter.isSelected);
|
|
8756
8775
|
const shouldHideNewWorkspace = !isAllSelectedForFilters || viewPresetListSearchQuery.length > 0;
|
|
8757
|
-
return
|
|
8776
|
+
return jsxs("div", Object.assign({
|
|
8758
8777
|
"data-testid": "viewpreset-selectlist-connect",
|
|
8759
8778
|
style: {
|
|
8760
8779
|
height: '100%'
|
|
8761
8780
|
}
|
|
8762
|
-
},
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8781
|
+
}, {
|
|
8782
|
+
children: [isViewPresetsListFetching && jsx(LinearProgress, {
|
|
8783
|
+
"data-testid": "loading-bar",
|
|
8784
|
+
color: "secondary",
|
|
8785
|
+
sx: {
|
|
8786
|
+
position: 'absolute',
|
|
8787
|
+
width: '100%',
|
|
8788
|
+
top: 0
|
|
8789
|
+
}
|
|
8790
|
+
}), !isViewPresetsListFetching && error && jsx(AlertBanner, Object.assign({
|
|
8791
|
+
title: t('workspace-viewpresets-error'),
|
|
8792
|
+
info: error.message,
|
|
8793
|
+
shouldClose: true
|
|
8794
|
+
}, error.errorType === ViewPresetErrorType.GENERIC && {
|
|
8795
|
+
actionButtonProps: {
|
|
8796
|
+
title: t('workspace-retry'),
|
|
8797
|
+
onClick: fetchViewPresets
|
|
8798
|
+
}
|
|
8799
|
+
})), jsxs(Box, Object.assign({
|
|
8800
|
+
sx: {
|
|
8801
|
+
padding: 1,
|
|
8802
|
+
height: '100%'
|
|
8803
|
+
}
|
|
8804
|
+
}, {
|
|
8805
|
+
children: [!error && jsx(WorkspaceFilter, {
|
|
8806
|
+
filters: viewPresetListFilters,
|
|
8807
|
+
onClickFilterChip: onClickFilterChip,
|
|
8808
|
+
isAllSelected: isAllSelectedForFilters,
|
|
8809
|
+
searchQuery: viewPresetListSearchQuery,
|
|
8810
|
+
onSearch: onSearchFilter
|
|
8811
|
+
}), jsx(WorkspaceSelectList, {
|
|
8812
|
+
workspacePresets: viewPresets,
|
|
8813
|
+
currentSelectedId: activeViewPresetId || undefined,
|
|
8814
|
+
onClickPreset: selectViewPreset,
|
|
8815
|
+
onClickWorkspacePresetOption: onClickViewPresetOption,
|
|
8816
|
+
newPreset: Object.assign(Object.assign({}, getEmptyWorkspaceListItem()), {
|
|
8817
|
+
title: t('workspace-mappreset-new')
|
|
8818
|
+
}),
|
|
8819
|
+
isLoggedIn: isLoggedIn,
|
|
8820
|
+
hideNewWorkspace: shouldHideNewWorkspace,
|
|
8821
|
+
searchQuery: viewPresetListSearchQuery,
|
|
8822
|
+
testIdPrefix: "viewpreset"
|
|
8823
|
+
})]
|
|
8824
|
+
}))]
|
|
8825
|
+
}));
|
|
8803
8826
|
};
|
|
8804
8827
|
|
|
8805
|
-
/* *
|
|
8806
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8807
|
-
* you may not use this file except in compliance with the License.
|
|
8808
|
-
* You may obtain a copy of the License at
|
|
8809
|
-
*
|
|
8810
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8811
|
-
*
|
|
8812
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8813
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8814
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8815
|
-
* See the License for the specific language governing permissions and
|
|
8816
|
-
* limitations under the License.
|
|
8817
|
-
*
|
|
8818
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8819
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
8820
|
-
* */
|
|
8821
8828
|
const ViewPresetMenu = ({
|
|
8822
8829
|
hideBackdrop: _hideBackdrop = false,
|
|
8823
8830
|
closeMenu,
|
|
@@ -8826,7 +8833,7 @@ const ViewPresetMenu = ({
|
|
|
8826
8833
|
const {
|
|
8827
8834
|
t
|
|
8828
8835
|
} = useWorkspaceTranslation();
|
|
8829
|
-
const toolContainer =
|
|
8836
|
+
const toolContainer = jsx(ToolContainer, Object.assign({
|
|
8830
8837
|
style: {
|
|
8831
8838
|
width: 320,
|
|
8832
8839
|
height: 'calc(100% - 80px)',
|
|
@@ -8838,23 +8845,29 @@ const ViewPresetMenu = ({
|
|
|
8838
8845
|
onClick: event => {
|
|
8839
8846
|
event.stopPropagation();
|
|
8840
8847
|
}
|
|
8841
|
-
},
|
|
8842
|
-
|
|
8848
|
+
}, {
|
|
8849
|
+
children: jsx(ViewPresetMenuListConnect, {
|
|
8850
|
+
panelId: panelId
|
|
8851
|
+
})
|
|
8843
8852
|
}));
|
|
8844
8853
|
renderCounter.count(ViewPresetMenu.name);
|
|
8845
|
-
return
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8854
|
+
return jsx("div", {
|
|
8855
|
+
children: _hideBackdrop ?
|
|
8856
|
+
// Enable hiding backdrop from snapshot tests
|
|
8857
|
+
toolContainer : jsx(Backdrop, Object.assign({
|
|
8858
|
+
"data-testid": "viewpresetMenuBackdrop",
|
|
8859
|
+
open: true,
|
|
8860
|
+
sx: {
|
|
8861
|
+
'&.MuiBackdrop-root': {
|
|
8862
|
+
position: 'absolute',
|
|
8863
|
+
zIndex: 1002
|
|
8864
|
+
}
|
|
8865
|
+
},
|
|
8866
|
+
onClick: closeMenu
|
|
8867
|
+
}, {
|
|
8868
|
+
children: toolContainer
|
|
8869
|
+
}))
|
|
8870
|
+
});
|
|
8858
8871
|
};
|
|
8859
8872
|
|
|
8860
8873
|
const WorkspaceOptionsNoMemo = ({
|
|
@@ -8901,7 +8914,7 @@ const WorkspaceOptionsNoMemo = ({
|
|
|
8901
8914
|
title: t('workspace-delete'),
|
|
8902
8915
|
callback: handleDelete
|
|
8903
8916
|
}];
|
|
8904
|
-
const renderButton = () => (
|
|
8917
|
+
const renderButton = () => jsxs(CustomToggleButton, Object.assign({
|
|
8905
8918
|
variant: "tool",
|
|
8906
8919
|
selected: isOpen,
|
|
8907
8920
|
onClick: handleClick,
|
|
@@ -8939,88 +8952,85 @@ const WorkspaceOptionsNoMemo = ({
|
|
|
8939
8952
|
}
|
|
8940
8953
|
},
|
|
8941
8954
|
role: "button"
|
|
8942
|
-
},
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
}, panelId)), /*#__PURE__*/React.createElement(Menu, {
|
|
8950
|
-
BackdropProps: {
|
|
8951
|
-
style: {
|
|
8952
|
-
opacity: 0,
|
|
8953
|
-
transition: 'none'
|
|
8955
|
+
}, {
|
|
8956
|
+
children: [title, panelId && jsx(Box, Object.assign({
|
|
8957
|
+
component: "span",
|
|
8958
|
+
sx: {
|
|
8959
|
+
fontStyle: 'normal',
|
|
8960
|
+
marginLeft: 1,
|
|
8961
|
+
color: 'geowebColors.captions.captionStatus.rgba'
|
|
8954
8962
|
}
|
|
8955
|
-
},
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
'& .MuiMenu-list': {
|
|
8964
|
-
padding: 0
|
|
8963
|
+
}, {
|
|
8964
|
+
children: panelId
|
|
8965
|
+
})), jsxs(Menu, Object.assign({
|
|
8966
|
+
BackdropProps: {
|
|
8967
|
+
style: {
|
|
8968
|
+
opacity: 0,
|
|
8969
|
+
transition: 'none'
|
|
8970
|
+
}
|
|
8965
8971
|
},
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8972
|
+
open: isOpen,
|
|
8973
|
+
anchorEl: anchorEl,
|
|
8974
|
+
anchorOrigin: {
|
|
8975
|
+
vertical: 21,
|
|
8976
|
+
horizontal: 6
|
|
8977
|
+
},
|
|
8978
|
+
sx: {
|
|
8979
|
+
'& .MuiMenu-list': {
|
|
8980
|
+
padding: 0
|
|
8981
|
+
},
|
|
8982
|
+
'& .MuiMenuItem-root': {
|
|
8983
|
+
fontSize: 16
|
|
8984
|
+
}
|
|
8985
|
+
}
|
|
8986
|
+
}, {
|
|
8987
|
+
children: [jsx(ListSubheader, Object.assign({
|
|
8988
|
+
sx: {
|
|
8989
|
+
paddingTop: '8px'
|
|
8990
|
+
}
|
|
8991
|
+
}, {
|
|
8992
|
+
children: jsx(Typography, Object.assign({
|
|
8993
|
+
sx: {
|
|
8994
|
+
letterSpacing: '0.4px',
|
|
8995
|
+
fontSize: 12
|
|
8996
|
+
}
|
|
8997
|
+
}, {
|
|
8998
|
+
children: t('workspace-options')
|
|
8999
|
+
}))
|
|
9000
|
+
})), options.map(({
|
|
9001
|
+
title,
|
|
9002
|
+
callback
|
|
9003
|
+
}) => jsx(MenuItem, Object.assign({
|
|
9004
|
+
onClick: callback,
|
|
9005
|
+
disabled: !callback
|
|
9006
|
+
}, {
|
|
9007
|
+
children: title
|
|
9008
|
+
}), title))]
|
|
9009
|
+
}))]
|
|
9010
|
+
}));
|
|
9011
|
+
return _isDisabled ? renderButton() : jsx(CustomTooltip, Object.assign({
|
|
8988
9012
|
title: !isOpen && title,
|
|
8989
9013
|
TransitionProps: {
|
|
8990
9014
|
exit: false
|
|
8991
9015
|
}
|
|
8992
|
-
},
|
|
9016
|
+
}, {
|
|
9017
|
+
children: renderButton()
|
|
9018
|
+
}));
|
|
8993
9019
|
};
|
|
8994
9020
|
const WorkspaceOptions = /*#__PURE__*/React.memo(WorkspaceOptionsNoMemo);
|
|
8995
9021
|
|
|
8996
|
-
/* *
|
|
8997
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8998
|
-
* you may not use this file except in compliance with the License.
|
|
8999
|
-
* You may obtain a copy of the License at
|
|
9000
|
-
*
|
|
9001
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9002
|
-
*
|
|
9003
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9004
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9005
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9006
|
-
* See the License for the specific language governing permissions and
|
|
9007
|
-
* limitations under the License.
|
|
9008
|
-
*
|
|
9009
|
-
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9010
|
-
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9011
|
-
* */
|
|
9012
9022
|
const LoadingIndicatorConnect = ({
|
|
9013
9023
|
panelId
|
|
9014
9024
|
}) => {
|
|
9015
9025
|
const isLoading = useSelector(store => loadingIndicatorSelectors.isLoading(store, panelId));
|
|
9016
|
-
return isLoading ? (
|
|
9026
|
+
return isLoading ? jsx(CloudLoading, {
|
|
9017
9027
|
"data-testid": "cloudicon-loading",
|
|
9018
9028
|
style: {
|
|
9019
9029
|
fill: '#186DFF'
|
|
9020
9030
|
}
|
|
9021
|
-
})
|
|
9031
|
+
}) : jsx(CloudIdle, {
|
|
9022
9032
|
"data-testid": "cloudicon-idle"
|
|
9023
|
-
})
|
|
9033
|
+
});
|
|
9024
9034
|
};
|
|
9025
9035
|
|
|
9026
9036
|
const customIconStyles = (theme, isViewPresetDialogOpen) => {
|
|
@@ -9150,46 +9160,34 @@ const WorkspaceViewTitleConnectNoMemo = ({
|
|
|
9150
9160
|
});
|
|
9151
9161
|
}, [isViewPresetDialogOpen, panelId, toggleViewPresetDialog]);
|
|
9152
9162
|
const style = React.useMemo(() => customIconStyles(theme, isViewPresetDialogOpen), [isViewPresetDialogOpen, theme]);
|
|
9153
|
-
const presetIcon = React.useMemo(() =>
|
|
9163
|
+
const presetIcon = React.useMemo(() => jsx(Preset, {}), []);
|
|
9154
9164
|
renderCounter.count(WorkspaceViewTitleConnectNoMemo.name);
|
|
9155
|
-
return
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9165
|
+
return jsxs(Fragment, {
|
|
9166
|
+
children: [jsx(CustomIconButton, Object.assign({
|
|
9167
|
+
"data-testid": "open-viewpresets",
|
|
9168
|
+
sx: style,
|
|
9169
|
+
variant: "tool",
|
|
9170
|
+
onClick: onClickOpenViewPreset,
|
|
9171
|
+
tooltipTitle: t('workspace-viewpreset-menu'),
|
|
9172
|
+
isSelected: isViewPresetDialogOpen
|
|
9173
|
+
}, {
|
|
9174
|
+
children: presetIcon
|
|
9175
|
+
})), jsx(WorkspaceOptions, {
|
|
9176
|
+
panelId: panelId,
|
|
9177
|
+
title: fullTitle,
|
|
9178
|
+
hasChanges: hasMapPresetChanges || isNewActive,
|
|
9179
|
+
handleSave: viewScope === 'user' ? onSave : undefined,
|
|
9180
|
+
handleDelete: viewScope === 'user' ? onDelete : undefined,
|
|
9181
|
+
handleSaveAs: onSaveAs,
|
|
9182
|
+
handleEdit: viewScope === 'user' ? onEdit : undefined,
|
|
9183
|
+
id: "viewpreset-options-toolbutton"
|
|
9184
|
+
}), jsx(LoadingIndicatorConnect, {
|
|
9185
|
+
panelId: panelId
|
|
9186
|
+
})]
|
|
9187
|
+
});
|
|
9174
9188
|
};
|
|
9175
9189
|
const WorkspaceViewTitleConnect = /*#__PURE__*/React.memo(WorkspaceViewTitleConnectNoMemo);
|
|
9176
9190
|
|
|
9177
|
-
/* *
|
|
9178
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9179
|
-
* you may not use this file except in compliance with the License.
|
|
9180
|
-
* You may obtain a copy of the License at
|
|
9181
|
-
*
|
|
9182
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9183
|
-
*
|
|
9184
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9185
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9186
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9187
|
-
* See the License for the specific language governing permissions and
|
|
9188
|
-
* limitations under the License.
|
|
9189
|
-
*
|
|
9190
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9191
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9192
|
-
* */
|
|
9193
9191
|
const WorkspaceTileConnect = /*#__PURE__*/React.memo(({
|
|
9194
9192
|
mosaicNodeId: _mosaicNodeId = '',
|
|
9195
9193
|
path,
|
|
@@ -9278,46 +9276,50 @@ const WorkspaceTileConnect = /*#__PURE__*/React.memo(({
|
|
|
9278
9276
|
componentType: view === null || view === void 0 ? void 0 : view.componentType,
|
|
9279
9277
|
mosaicNodeId: _mosaicNodeId
|
|
9280
9278
|
}), [_mosaicNodeId, view === null || view === void 0 ? void 0 : view.componentType, view === null || view === void 0 ? void 0 : view.id]);
|
|
9281
|
-
return
|
|
9279
|
+
return jsxs(MosaicWindow, Object.assign({
|
|
9282
9280
|
path: path,
|
|
9283
9281
|
createNode: createNode,
|
|
9284
|
-
title: (
|
|
9282
|
+
title: jsx(WorkspaceViewTitleConnect, {
|
|
9285
9283
|
panelId: _mosaicNodeId,
|
|
9286
9284
|
isViewPresetDialogOpen: isViewPresetDialogOpen || false
|
|
9287
|
-
})
|
|
9288
|
-
toolbarControls:
|
|
9285
|
+
}),
|
|
9286
|
+
toolbarControls: jsx(WorkspaceControls, {
|
|
9289
9287
|
createNode: createNode,
|
|
9290
9288
|
path: path,
|
|
9291
9289
|
shouldPreventCloseView: shouldPreventCloseView
|
|
9292
9290
|
})
|
|
9293
|
-
},
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9291
|
+
}, {
|
|
9292
|
+
children: [isViewPresetsFetching && jsx(LinearProgress, {
|
|
9293
|
+
"data-testid": "loading-bar",
|
|
9294
|
+
color: "secondary",
|
|
9295
|
+
sx: {
|
|
9296
|
+
position: 'absolute',
|
|
9297
|
+
width: '100%',
|
|
9298
|
+
top: 0,
|
|
9299
|
+
zIndex: 1001
|
|
9300
|
+
}
|
|
9301
|
+
}), errorViewPreset && jsx(Box, Object.assign({
|
|
9302
|
+
sx: {
|
|
9303
|
+
position: 'absolute',
|
|
9304
|
+
left: 0,
|
|
9305
|
+
right: 0,
|
|
9306
|
+
zIndex: 1002
|
|
9307
|
+
}
|
|
9308
|
+
}, {
|
|
9309
|
+
children: jsx(AlertBanner, {
|
|
9310
|
+
title: errorViewPreset,
|
|
9311
|
+
shouldClose: true
|
|
9312
|
+
})
|
|
9313
|
+
})), defaultComponentsLookupResult, genericComponentsLookupResult, isViewPresetDialogOpen && jsx(ViewPresetMenu, {
|
|
9314
|
+
panelId: _mosaicNodeId,
|
|
9315
|
+
closeMenu: () => {
|
|
9316
|
+
toggleViewPresetDialog({
|
|
9317
|
+
panelId: _mosaicNodeId,
|
|
9318
|
+
isViewPresetDialogOpen: false
|
|
9319
|
+
});
|
|
9320
|
+
}
|
|
9321
|
+
})]
|
|
9322
|
+
}));
|
|
9321
9323
|
}, _.isEqual);
|
|
9322
9324
|
|
|
9323
9325
|
const WorkspaceView = ({
|
|
@@ -9331,7 +9333,7 @@ const WorkspaceView = ({
|
|
|
9331
9333
|
const {
|
|
9332
9334
|
t
|
|
9333
9335
|
} = useWorkspaceTranslation();
|
|
9334
|
-
const EmptyView = !_isWorkspaceLoading && (
|
|
9336
|
+
const EmptyView = !_isWorkspaceLoading && jsxs(Box, Object.assign({
|
|
9335
9337
|
sx: {
|
|
9336
9338
|
backgroundColor: 'geowebColors.background.surface',
|
|
9337
9339
|
display: 'flex',
|
|
@@ -9340,16 +9342,20 @@ const WorkspaceView = ({
|
|
|
9340
9342
|
alignItems: 'center',
|
|
9341
9343
|
height: '100%'
|
|
9342
9344
|
}
|
|
9343
|
-
},
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9345
|
+
}, {
|
|
9346
|
+
children: [jsx(WebAssetOff, {
|
|
9347
|
+
sx: {
|
|
9348
|
+
fontSize: '150px',
|
|
9349
|
+
margin: '20px'
|
|
9350
|
+
}
|
|
9351
|
+
}), jsx(Typography, Object.assign({
|
|
9352
|
+
sx: {
|
|
9353
|
+
color: 'geowebColors.typographyAndIcons.text'
|
|
9354
|
+
}
|
|
9355
|
+
}, {
|
|
9356
|
+
children: t('geoweb-welcome')
|
|
9357
|
+
}))]
|
|
9358
|
+
}));
|
|
9353
9359
|
useControlActiveWindowId(screenConfig, activeWindowId, setActiveWindowId);
|
|
9354
9360
|
const getNewViewId = (element, viewId) => {
|
|
9355
9361
|
if (element instanceof Element) {
|
|
@@ -9372,7 +9378,7 @@ const WorkspaceView = ({
|
|
|
9372
9378
|
setActiveWindowId(newViewId);
|
|
9373
9379
|
}
|
|
9374
9380
|
};
|
|
9375
|
-
return
|
|
9381
|
+
return jsx(Box, Object.assign({
|
|
9376
9382
|
sx: {
|
|
9377
9383
|
height: '100%',
|
|
9378
9384
|
'.geoweb-mosaic .mosaic-window-title': {
|
|
@@ -9384,43 +9390,47 @@ const WorkspaceView = ({
|
|
|
9384
9390
|
backgroundColor: 'geowebColors.background.surfaceApp'
|
|
9385
9391
|
}
|
|
9386
9392
|
}
|
|
9387
|
-
},
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9393
|
+
}, {
|
|
9394
|
+
children: jsx(Mosaic, {
|
|
9395
|
+
className: "geoweb-mosaic",
|
|
9396
|
+
zeroStateView: EmptyView || undefined,
|
|
9397
|
+
initialValue: screenConfig.mosaicNode,
|
|
9398
|
+
renderTile: (viewId, path) => {
|
|
9399
|
+
const windowIsActive = viewId === activeWindowId;
|
|
9400
|
+
return jsx(Box, Object.assign({
|
|
9401
|
+
onClick: event => handleClickOnWindow(event, viewId),
|
|
9402
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
9403
|
+
sx: theme => ({
|
|
9404
|
+
'> *': {
|
|
9405
|
+
height: '100%',
|
|
9406
|
+
width: '100%'
|
|
9407
|
+
},
|
|
9408
|
+
'.mosaic-window .mosaic-window-toolbar': {
|
|
9409
|
+
backgroundColor: windowIsActive ? theme.palette.geowebColors.workspace.activeWindow : theme.palette.geowebColors.workspace.inactiveWindow
|
|
9410
|
+
},
|
|
9411
|
+
'.mosaic-window-toolbar .MuiSvgIcon-root': {
|
|
9412
|
+
fill: windowIsActive ? theme.palette.geowebColors.buttons.flat.default.color : theme.palette.geowebColors.buttons.flat.disabled.color
|
|
9413
|
+
},
|
|
9414
|
+
'#close-window-button .MuiSvgIcon-root': {
|
|
9415
|
+
fill: theme.palette.geowebColors.buttons.flat.disabled.color
|
|
9416
|
+
},
|
|
9417
|
+
'.mosaic-window-toolbar .mosaic-window-title': {
|
|
9418
|
+
color: windowIsActive ? theme.palette.geowebColors.typographyAndIcons.text : theme.palette.geowebColors.typographyAndIcons.inactiveText
|
|
9419
|
+
}
|
|
9420
|
+
})
|
|
9421
|
+
}, {
|
|
9422
|
+
children: jsx(WorkspaceTileConnect, {
|
|
9423
|
+
mosaicNodeId: viewId,
|
|
9424
|
+
path: path,
|
|
9425
|
+
componentsLookUp: componentsLookUp
|
|
9426
|
+
})
|
|
9427
|
+
}));
|
|
9428
|
+
},
|
|
9429
|
+
onRelease: node => updateViews(node),
|
|
9430
|
+
resize: {
|
|
9431
|
+
minimumPaneSizePercentage: screenConfig.minimumPaneSizePercentage || 20
|
|
9432
|
+
}
|
|
9433
|
+
})
|
|
9424
9434
|
}));
|
|
9425
9435
|
};
|
|
9426
9436
|
const useControlActiveWindowId = (screenConfig, activeWindowId, setActiveWindowId) => {
|
|
@@ -9446,22 +9456,6 @@ const useControlActiveWindowId = (screenConfig, activeWindowId, setActiveWindowI
|
|
|
9446
9456
|
}, [activeWindowId, screenConfig.views, screenConfig.views.allIds, setActiveWindowId]);
|
|
9447
9457
|
};
|
|
9448
9458
|
|
|
9449
|
-
/* *
|
|
9450
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9451
|
-
* you may not use this file except in compliance with the License.
|
|
9452
|
-
* You may obtain a copy of the License at
|
|
9453
|
-
*
|
|
9454
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9455
|
-
*
|
|
9456
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9457
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9458
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9459
|
-
* See the License for the specific language governing permissions and
|
|
9460
|
-
* limitations under the License.
|
|
9461
|
-
*
|
|
9462
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9463
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
9464
|
-
* */
|
|
9465
9459
|
const WorkspaceViewConnect = ({
|
|
9466
9460
|
componentsLookUp
|
|
9467
9461
|
}) => {
|
|
@@ -9492,7 +9486,7 @@ const WorkspaceViewConnect = ({
|
|
|
9492
9486
|
window.addEventListener('orientationchange', handleOrientationChange);
|
|
9493
9487
|
return () => window.removeEventListener('orientationchange', handleOrientationChange);
|
|
9494
9488
|
}, [handleOrientationChange]);
|
|
9495
|
-
return
|
|
9489
|
+
return jsx(WorkspaceView, {
|
|
9496
9490
|
screenConfig: screenConfig,
|
|
9497
9491
|
componentsLookUp: componentsLookUp,
|
|
9498
9492
|
updateViews: updateViews,
|
|
@@ -9626,71 +9620,61 @@ const WorkspaceSelectListConnect = () => {
|
|
|
9626
9620
|
const {
|
|
9627
9621
|
t
|
|
9628
9622
|
} = useWorkspaceTranslation();
|
|
9629
|
-
return
|
|
9623
|
+
return jsxs("div", Object.assign({
|
|
9630
9624
|
"data-testid": "workspace-selectlist-connect",
|
|
9631
9625
|
style: {
|
|
9632
9626
|
height: '100%'
|
|
9633
9627
|
}
|
|
9634
|
-
},
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9628
|
+
}, {
|
|
9629
|
+
children: [isFetching && jsx(LinearProgress, {
|
|
9630
|
+
"data-testid": "loading-bar",
|
|
9631
|
+
color: "secondary",
|
|
9632
|
+
sx: {
|
|
9633
|
+
position: 'absolute',
|
|
9634
|
+
width: '100%',
|
|
9635
|
+
top: 0,
|
|
9636
|
+
left: 0
|
|
9637
|
+
}
|
|
9638
|
+
}), error && jsx("div", Object.assign({
|
|
9639
|
+
style: {
|
|
9640
|
+
whiteSpace: 'normal'
|
|
9641
|
+
}
|
|
9642
|
+
}, {
|
|
9643
|
+
children: jsx(AlertBanner, Object.assign({
|
|
9644
|
+
title: t('workspace-error-fetch'),
|
|
9645
|
+
info: error.message,
|
|
9646
|
+
shouldClose: true
|
|
9647
|
+
}, error.type === WorkspaceListErrorType.GENERIC && {
|
|
9648
|
+
actionButtonProps: {
|
|
9649
|
+
title: t('workspace-retry'),
|
|
9650
|
+
onClick: () => fetchWorkspaceList()
|
|
9651
|
+
}
|
|
9652
|
+
}))
|
|
9653
|
+
})), jsxs(Box, Object.assign({
|
|
9654
|
+
sx: {
|
|
9655
|
+
padding: 1,
|
|
9656
|
+
height: '100%'
|
|
9657
|
+
}
|
|
9658
|
+
}, {
|
|
9659
|
+
children: [!error && jsx(WorkspaceFilter, {
|
|
9660
|
+
filters: workspaceListFilters,
|
|
9661
|
+
onClickFilterChip: onClickFilterChip,
|
|
9662
|
+
isAllSelected: isAllSelected,
|
|
9663
|
+
searchQuery: workspaceSearchQuery,
|
|
9664
|
+
onSearch: searchFilter
|
|
9665
|
+
}), jsx(WorkspaceSelectList, {
|
|
9666
|
+
workspacePresets: workspacePresets,
|
|
9667
|
+
currentSelectedId: currentView.id || '',
|
|
9668
|
+
onClickPreset: onClickWorkspace,
|
|
9669
|
+
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
9670
|
+
hideNewWorkspace: shouldHideNewWorkspace,
|
|
9671
|
+
isLoggedIn: isLoggedIn,
|
|
9672
|
+
searchQuery: workspaceSearchQuery
|
|
9673
|
+
})]
|
|
9674
|
+
}))]
|
|
9675
|
+
}));
|
|
9676
9676
|
};
|
|
9677
9677
|
|
|
9678
|
-
/* *
|
|
9679
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9680
|
-
* you may not use this file except in compliance with the License.
|
|
9681
|
-
* You may obtain a copy of the License at
|
|
9682
|
-
*
|
|
9683
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9684
|
-
*
|
|
9685
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9686
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9687
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9688
|
-
* See the License for the specific language governing permissions and
|
|
9689
|
-
* limitations under the License.
|
|
9690
|
-
*
|
|
9691
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9692
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9693
|
-
* */
|
|
9694
9678
|
const WorkspaceMenu = ({
|
|
9695
9679
|
hideBackdrop: _hideBackdrop = false,
|
|
9696
9680
|
closeMenu
|
|
@@ -9698,7 +9682,7 @@ const WorkspaceMenu = ({
|
|
|
9698
9682
|
const {
|
|
9699
9683
|
t
|
|
9700
9684
|
} = useWorkspaceTranslation();
|
|
9701
|
-
const toolContainer =
|
|
9685
|
+
const toolContainer = jsx(ToolContainer, Object.assign({
|
|
9702
9686
|
style: {
|
|
9703
9687
|
width: 320,
|
|
9704
9688
|
height: 'calc(100vh - 88px)',
|
|
@@ -9710,37 +9694,27 @@ const WorkspaceMenu = ({
|
|
|
9710
9694
|
onClick: event => {
|
|
9711
9695
|
event.stopPropagation();
|
|
9712
9696
|
}
|
|
9713
|
-
},
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9697
|
+
}, {
|
|
9698
|
+
children: jsx(WorkspaceSelectListConnect, {})
|
|
9699
|
+
}));
|
|
9700
|
+
return jsx("div", {
|
|
9701
|
+
children: _hideBackdrop ?
|
|
9702
|
+
// Enable hiding backdrop from snapshot tests
|
|
9703
|
+
toolContainer : jsx(Backdrop, Object.assign({
|
|
9704
|
+
"data-testid": "workspaceMenuBackdrop",
|
|
9705
|
+
open: true,
|
|
9706
|
+
sx: {
|
|
9707
|
+
'&.MuiBackdrop-root': {
|
|
9708
|
+
top: '40px'
|
|
9709
|
+
}
|
|
9710
|
+
},
|
|
9711
|
+
onClick: closeMenu
|
|
9712
|
+
}, {
|
|
9713
|
+
children: toolContainer
|
|
9714
|
+
}))
|
|
9715
|
+
});
|
|
9726
9716
|
};
|
|
9727
9717
|
|
|
9728
|
-
/* *
|
|
9729
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9730
|
-
* you may not use this file except in compliance with the License.
|
|
9731
|
-
* You may obtain a copy of the License at
|
|
9732
|
-
*
|
|
9733
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9734
|
-
*
|
|
9735
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9736
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9737
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9738
|
-
* See the License for the specific language governing permissions and
|
|
9739
|
-
* limitations under the License.
|
|
9740
|
-
*
|
|
9741
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9742
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9743
|
-
* */
|
|
9744
9718
|
const WorkspaceMenuButton = ({
|
|
9745
9719
|
showMenu: _showMenu = false,
|
|
9746
9720
|
onToggleDialog: _onToggleDialog = () => {}
|
|
@@ -9752,49 +9726,39 @@ const WorkspaceMenuButton = ({
|
|
|
9752
9726
|
t
|
|
9753
9727
|
} = useWorkspaceTranslation();
|
|
9754
9728
|
const tooltipTitle = t('workspace-menu');
|
|
9755
|
-
return
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
}, /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
9761
|
-
onClick: () => {
|
|
9762
|
-
_onToggleDialog(!_showMenu);
|
|
9763
|
-
},
|
|
9764
|
-
"data-testid": "workspaceMenuButton",
|
|
9765
|
-
isSelected: _showMenu,
|
|
9766
|
-
"aria-label": "workspace menu",
|
|
9767
|
-
variant: "tool",
|
|
9768
|
-
tooltipTitle: tooltipTitle,
|
|
9769
|
-
sx: {
|
|
9770
|
-
'&&': {
|
|
9771
|
-
backgroundColor: !_showMenu ? 'transparent' : undefined,
|
|
9772
|
-
'&:hover': {
|
|
9773
|
-
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
9774
|
-
}
|
|
9729
|
+
return jsxs("div", {
|
|
9730
|
+
children: [jsx(Box, Object.assign({
|
|
9731
|
+
sx: {
|
|
9732
|
+
padding: '4px 8px',
|
|
9733
|
+
flexGrow: 1
|
|
9775
9734
|
}
|
|
9776
|
-
}
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9735
|
+
}, {
|
|
9736
|
+
children: jsx(CustomIconButton, Object.assign({
|
|
9737
|
+
onClick: () => {
|
|
9738
|
+
_onToggleDialog(!_showMenu);
|
|
9739
|
+
},
|
|
9740
|
+
"data-testid": "workspaceMenuButton",
|
|
9741
|
+
isSelected: _showMenu,
|
|
9742
|
+
"aria-label": "workspace menu",
|
|
9743
|
+
variant: "tool",
|
|
9744
|
+
tooltipTitle: tooltipTitle,
|
|
9745
|
+
sx: {
|
|
9746
|
+
'&&': {
|
|
9747
|
+
backgroundColor: !_showMenu ? 'transparent' : undefined,
|
|
9748
|
+
'&:hover': {
|
|
9749
|
+
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
9750
|
+
}
|
|
9751
|
+
}
|
|
9752
|
+
}
|
|
9753
|
+
}, {
|
|
9754
|
+
children: jsx(PresetWorkspace, {})
|
|
9755
|
+
}))
|
|
9756
|
+
})), _showMenu && jsx(WorkspaceMenu, {
|
|
9757
|
+
closeMenu: onCloseMenu
|
|
9758
|
+
})]
|
|
9759
|
+
});
|
|
9780
9760
|
};
|
|
9781
9761
|
|
|
9782
|
-
/* *
|
|
9783
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9784
|
-
* you may not use this file except in compliance with the License.
|
|
9785
|
-
* You may obtain a copy of the License at
|
|
9786
|
-
*
|
|
9787
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9788
|
-
*
|
|
9789
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9790
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9791
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9792
|
-
* See the License for the specific language governing permissions and
|
|
9793
|
-
* limitations under the License.
|
|
9794
|
-
*
|
|
9795
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9796
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9797
|
-
* */
|
|
9798
9762
|
const FetchInitialPresets$1 = () => {
|
|
9799
9763
|
const dispatch = useDispatch();
|
|
9800
9764
|
const fetchInitialPresets = React__default.useCallback(() => {
|
|
@@ -9817,10 +9781,12 @@ const WorkspaceMenuButtonConnect = () => {
|
|
|
9817
9781
|
}));
|
|
9818
9782
|
}, [dispatch]);
|
|
9819
9783
|
const isWorkspaceListDialogOpen = useSelector(store => getIsWorkspaceListDialogOpen(store));
|
|
9820
|
-
return
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9784
|
+
return jsxs(Fragment, {
|
|
9785
|
+
children: [jsx(FetchInitialPresets$1, {}), jsx(WorkspaceMenuButton, {
|
|
9786
|
+
showMenu: isWorkspaceListDialogOpen,
|
|
9787
|
+
onToggleDialog: setListDialogOpen
|
|
9788
|
+
})]
|
|
9789
|
+
});
|
|
9824
9790
|
};
|
|
9825
9791
|
|
|
9826
9792
|
const WorkspaceOptionsConnect = ({
|
|
@@ -9887,7 +9853,7 @@ const WorkspaceOptionsConnect = ({
|
|
|
9887
9853
|
return `${title} (${suffix})`;
|
|
9888
9854
|
};
|
|
9889
9855
|
const fullTitle = getTitle(title, hasChanges, workspaceId);
|
|
9890
|
-
return
|
|
9856
|
+
return jsx(WorkspaceOptions, {
|
|
9891
9857
|
hasChanges: hasChanges,
|
|
9892
9858
|
title: fullTitle,
|
|
9893
9859
|
activeTab: activeTab,
|
|
@@ -9900,38 +9866,24 @@ const WorkspaceOptionsConnect = ({
|
|
|
9900
9866
|
});
|
|
9901
9867
|
};
|
|
9902
9868
|
|
|
9903
|
-
/* *
|
|
9904
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9905
|
-
* you may not use this file except in compliance with the License.
|
|
9906
|
-
* You may obtain a copy of the License at
|
|
9907
|
-
*
|
|
9908
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9909
|
-
*
|
|
9910
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9911
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9912
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9913
|
-
* See the License for the specific language governing permissions and
|
|
9914
|
-
* limitations under the License.
|
|
9915
|
-
*
|
|
9916
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9917
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9918
|
-
* */
|
|
9919
9869
|
const WorkspaceTab = ({
|
|
9920
9870
|
title,
|
|
9921
9871
|
activeTab,
|
|
9922
9872
|
workspaceId
|
|
9923
9873
|
}) => {
|
|
9924
|
-
return
|
|
9874
|
+
return jsxs(Box$1, Object.assign({
|
|
9925
9875
|
sx: {
|
|
9926
9876
|
display: 'flex',
|
|
9927
9877
|
flexDirection: 'row',
|
|
9928
9878
|
alignItems: 'center'
|
|
9929
9879
|
},
|
|
9930
9880
|
"data-testid": "workspaceTab"
|
|
9931
|
-
},
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9881
|
+
}, {
|
|
9882
|
+
children: [jsx(WorkspaceMenuButtonConnect, {}), jsx(WorkspaceOptionsConnect, {
|
|
9883
|
+
title: title,
|
|
9884
|
+
activeTab: activeTab,
|
|
9885
|
+
workspaceId: workspaceId
|
|
9886
|
+
})]
|
|
9935
9887
|
}));
|
|
9936
9888
|
};
|
|
9937
9889
|
|
|
@@ -9978,57 +9930,67 @@ const WorkspacePresetsForm = ({
|
|
|
9978
9930
|
const hasFormInput = action === WorkspacePresetAction.DUPLICATE || action === WorkspacePresetAction.SAVE_AS || action === WorkspacePresetAction.SAVE_ALL || action === WorkspacePresetAction.EDIT;
|
|
9979
9931
|
// disable form inputs for 'Save (incl. viewpresets)' existing workspace preset
|
|
9980
9932
|
const isDisabled = action === WorkspacePresetAction.SAVE_ALL && formValues.id !== undefined && formValues.id !== '' && formValues.scope === 'user';
|
|
9981
|
-
return
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
}, /*#__PURE__*/React__default.createElement(AlertBanner, {
|
|
9986
|
-
title: error
|
|
9987
|
-
}))), hasFormInput && ( /*#__PURE__*/React__default.createElement("form", {
|
|
9988
|
-
"data-testid": "workspace-preset-form",
|
|
9989
|
-
onSubmit: onSubmitForm
|
|
9990
|
-
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
9991
|
-
sx: {
|
|
9992
|
-
marginBottom: 2
|
|
9993
|
-
}
|
|
9994
|
-
}, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
|
|
9995
|
-
name: "title",
|
|
9996
|
-
label: t('workspace-dialog-name'),
|
|
9997
|
-
rules: {
|
|
9998
|
-
required: true,
|
|
9999
|
-
validate: {
|
|
10000
|
-
validateTitle: validateTitle$1
|
|
9933
|
+
return jsxs(Fragment, {
|
|
9934
|
+
children: [Boolean(error) && jsx(Box, Object.assign({
|
|
9935
|
+
sx: {
|
|
9936
|
+
marginBottom: 2
|
|
10001
9937
|
}
|
|
10002
|
-
},
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
9938
|
+
}, {
|
|
9939
|
+
children: jsx(AlertBanner, {
|
|
9940
|
+
title: error
|
|
9941
|
+
})
|
|
9942
|
+
})), hasFormInput && jsxs("form", Object.assign({
|
|
9943
|
+
"data-testid": "workspace-preset-form",
|
|
9944
|
+
onSubmit: onSubmitForm
|
|
9945
|
+
}, {
|
|
9946
|
+
children: [jsx(Box, Object.assign({
|
|
9947
|
+
sx: {
|
|
9948
|
+
marginBottom: 2
|
|
9949
|
+
}
|
|
9950
|
+
}, {
|
|
9951
|
+
children: jsx(ReactHookFormTextField, {
|
|
9952
|
+
name: "title",
|
|
9953
|
+
label: t('workspace-dialog-name'),
|
|
9954
|
+
rules: {
|
|
9955
|
+
required: true,
|
|
9956
|
+
validate: {
|
|
9957
|
+
validateTitle: validateTitle$1
|
|
9958
|
+
}
|
|
9959
|
+
},
|
|
9960
|
+
disabled: isDisabled,
|
|
9961
|
+
defaultValue: title
|
|
9962
|
+
})
|
|
9963
|
+
})), jsx(ReactHookFormTextField, {
|
|
9964
|
+
name: "abstract",
|
|
9965
|
+
label: t('workspace-dialog-abstract'),
|
|
9966
|
+
rules: {
|
|
9967
|
+
required: false
|
|
9968
|
+
},
|
|
9969
|
+
multiline: true,
|
|
9970
|
+
rows: 3,
|
|
9971
|
+
disabled: isDisabled,
|
|
9972
|
+
defaultValue: abstract
|
|
9973
|
+
}), hiddenFields.map(({
|
|
9974
|
+
name,
|
|
9975
|
+
value
|
|
9976
|
+
}) => jsx(ReactHookFormHiddenInput, {
|
|
9977
|
+
name: name,
|
|
9978
|
+
defaultValue: value,
|
|
9979
|
+
"data-testid": name
|
|
9980
|
+
}, name))]
|
|
9981
|
+
})), action === WorkspacePresetAction.DELETE && jsxs(Fragment, {
|
|
9982
|
+
children: [jsx(Typography, Object.assign({
|
|
9983
|
+
variant: "body1"
|
|
9984
|
+
}, {
|
|
9985
|
+
children: t('workspace-dialog-confirm-delete-message', {
|
|
9986
|
+
TITLE: title
|
|
9987
|
+
})
|
|
9988
|
+
})), jsx(ReactHookFormHiddenInput, {
|
|
9989
|
+
name: "title",
|
|
9990
|
+
defaultValue: title
|
|
9991
|
+
}, "title")]
|
|
9992
|
+
})]
|
|
9993
|
+
});
|
|
10032
9994
|
};
|
|
10033
9995
|
|
|
10034
9996
|
const WorkspacePresetsFormDialog = ({
|
|
@@ -10105,7 +10067,7 @@ const WorkspacePresetsFormDialog = ({
|
|
|
10105
10067
|
})();
|
|
10106
10068
|
};
|
|
10107
10069
|
const cancelLabel = t('workspace-cancel');
|
|
10108
|
-
return
|
|
10070
|
+
return jsx(ConfirmationDialog, {
|
|
10109
10071
|
"data-testid": "workspace-preset-dialog",
|
|
10110
10072
|
title: getDialogTitle(action),
|
|
10111
10073
|
open: isOpen,
|
|
@@ -10118,7 +10080,7 @@ const WorkspacePresetsFormDialog = ({
|
|
|
10118
10080
|
sx: {
|
|
10119
10081
|
width: '330px'
|
|
10120
10082
|
},
|
|
10121
|
-
content:
|
|
10083
|
+
content: jsx(WorkspacePresetsForm, {
|
|
10122
10084
|
formValues: formValues,
|
|
10123
10085
|
error: error,
|
|
10124
10086
|
onSubmit: onSubmit,
|
|
@@ -10128,27 +10090,13 @@ const WorkspacePresetsFormDialog = ({
|
|
|
10128
10090
|
};
|
|
10129
10091
|
const WorkspacePresetsFormDialogWrapper = _a => {
|
|
10130
10092
|
var props = __rest(_a, []);
|
|
10131
|
-
return
|
|
10093
|
+
return jsx(ReactHookFormProvider, Object.assign({
|
|
10132
10094
|
options: Object.assign({}, defaultFormOptions)
|
|
10133
|
-
},
|
|
10095
|
+
}, {
|
|
10096
|
+
children: jsx(WorkspacePresetsFormDialog, Object.assign({}, props))
|
|
10097
|
+
}));
|
|
10134
10098
|
};
|
|
10135
10099
|
|
|
10136
|
-
/* *
|
|
10137
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10138
|
-
* you may not use this file except in compliance with the License.
|
|
10139
|
-
* You may obtain a copy of the License at
|
|
10140
|
-
*
|
|
10141
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10142
|
-
*
|
|
10143
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
10144
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10145
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10146
|
-
* See the License for the specific language governing permissions and
|
|
10147
|
-
* limitations under the License.
|
|
10148
|
-
*
|
|
10149
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10150
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
10151
|
-
* */
|
|
10152
10100
|
const WorkspaceTabConnect = ({
|
|
10153
10101
|
workspaceId
|
|
10154
10102
|
}) => {
|
|
@@ -10171,42 +10119,28 @@ const WorkspaceTabConnect = ({
|
|
|
10171
10119
|
const formValues = typeof dialogDetails === 'object' && dialogDetails.formValues;
|
|
10172
10120
|
const isFetching = typeof dialogDetails === 'object' && dialogDetails.isFetching || false;
|
|
10173
10121
|
const error = typeof dialogDetails === 'object' && ((_a = dialogDetails.error) === null || _a === void 0 ? void 0 : _a.message);
|
|
10174
|
-
return
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10122
|
+
return jsxs(Fragment, {
|
|
10123
|
+
children: [jsx(WorkspaceTab, {
|
|
10124
|
+
activeTab: true,
|
|
10125
|
+
title: title,
|
|
10126
|
+
workspaceId: workspaceId
|
|
10127
|
+
}), Boolean(dialogDetails) && jsx(WorkspacePresetsFormDialogWrapper, {
|
|
10128
|
+
isOpen: Boolean(dialogDetails),
|
|
10129
|
+
onClose: closeWorkspaceActionDialog,
|
|
10130
|
+
presetId: presetId || undefined,
|
|
10131
|
+
action: action || undefined,
|
|
10132
|
+
formValues: formValues || undefined,
|
|
10133
|
+
onFormSubmit: onSubmitForm,
|
|
10134
|
+
isLoading: isFetching,
|
|
10135
|
+
error: error || undefined
|
|
10136
|
+
})]
|
|
10137
|
+
});
|
|
10188
10138
|
};
|
|
10189
10139
|
|
|
10190
|
-
/* *
|
|
10191
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10192
|
-
* you may not use this file except in compliance with the License.
|
|
10193
|
-
* You may obtain a copy of the License at
|
|
10194
|
-
*
|
|
10195
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10196
|
-
*
|
|
10197
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
10198
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10199
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10200
|
-
* See the License for the specific language governing permissions and
|
|
10201
|
-
* limitations under the License.
|
|
10202
|
-
*
|
|
10203
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10204
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
10205
|
-
* */
|
|
10206
10140
|
const WorkspaceTopBar = ({
|
|
10207
10141
|
workspaceId
|
|
10208
10142
|
}) => {
|
|
10209
|
-
return
|
|
10143
|
+
return jsx(Tabs, Object.assign({
|
|
10210
10144
|
value: 0,
|
|
10211
10145
|
"aria-label": "workspace-bar-tabs",
|
|
10212
10146
|
sx: {
|
|
@@ -10219,8 +10153,10 @@ const WorkspaceTopBar = ({
|
|
|
10219
10153
|
height: '100%'
|
|
10220
10154
|
}
|
|
10221
10155
|
}
|
|
10222
|
-
},
|
|
10223
|
-
|
|
10156
|
+
}, {
|
|
10157
|
+
children: jsx(WorkspaceTabConnect, {
|
|
10158
|
+
workspaceId: workspaceId
|
|
10159
|
+
})
|
|
10224
10160
|
}));
|
|
10225
10161
|
};
|
|
10226
10162
|
|
|
@@ -10259,42 +10195,50 @@ const MapPresetsForm = ({
|
|
|
10259
10195
|
event.preventDefault();
|
|
10260
10196
|
onSubmit();
|
|
10261
10197
|
};
|
|
10262
|
-
return
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
}, /*#__PURE__*/React__default.createElement(AlertBanner, {
|
|
10267
|
-
title: error
|
|
10268
|
-
}))), (action === PresetAction.SAVE_AS || action === PresetAction.EDIT) && ( /*#__PURE__*/React__default.createElement("form", {
|
|
10269
|
-
"data-testid": "map-preset-form",
|
|
10270
|
-
onSubmit: onSubmitForm
|
|
10271
|
-
}, /*#__PURE__*/React__default.createElement(ReactHookFormTextField, {
|
|
10272
|
-
name: "title",
|
|
10273
|
-
label: t('workspace-mappreset-dialog-title'),
|
|
10274
|
-
rules: {
|
|
10275
|
-
required: true,
|
|
10276
|
-
validate: {
|
|
10277
|
-
validateTitle
|
|
10198
|
+
return jsxs(Fragment, {
|
|
10199
|
+
children: [Boolean(error) && jsx(Box, Object.assign({
|
|
10200
|
+
sx: {
|
|
10201
|
+
marginBottom: 2
|
|
10278
10202
|
}
|
|
10279
|
-
},
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10203
|
+
}, {
|
|
10204
|
+
children: jsx(AlertBanner, {
|
|
10205
|
+
title: error
|
|
10206
|
+
})
|
|
10207
|
+
})), (action === PresetAction.SAVE_AS || action === PresetAction.EDIT) && jsxs("form", Object.assign({
|
|
10208
|
+
"data-testid": "map-preset-form",
|
|
10209
|
+
onSubmit: onSubmitForm
|
|
10210
|
+
}, {
|
|
10211
|
+
children: [jsx(ReactHookFormTextField, {
|
|
10212
|
+
name: "title",
|
|
10213
|
+
label: t('workspace-mappreset-dialog-title'),
|
|
10214
|
+
rules: {
|
|
10215
|
+
required: true,
|
|
10216
|
+
validate: {
|
|
10217
|
+
validateTitle
|
|
10218
|
+
}
|
|
10219
|
+
},
|
|
10220
|
+
defaultValue: title
|
|
10221
|
+
}), hiddenFields.map(({
|
|
10222
|
+
name,
|
|
10223
|
+
value
|
|
10224
|
+
}) => jsx(ReactHookFormHiddenInput, {
|
|
10225
|
+
name: name,
|
|
10226
|
+
defaultValue: value,
|
|
10227
|
+
"data-testid": name
|
|
10228
|
+
}, name))]
|
|
10229
|
+
})), action === PresetAction.DELETE && jsxs(Fragment, {
|
|
10230
|
+
children: [jsx(Typography, Object.assign({
|
|
10231
|
+
variant: "body1"
|
|
10232
|
+
}, {
|
|
10233
|
+
children: t('workspace-mappreset-delete-message', {
|
|
10234
|
+
TITLE: title
|
|
10235
|
+
})
|
|
10236
|
+
})), jsx(ReactHookFormHiddenInput, {
|
|
10237
|
+
name: "title",
|
|
10238
|
+
defaultValue: title
|
|
10239
|
+
}, "title")]
|
|
10240
|
+
})]
|
|
10241
|
+
});
|
|
10298
10242
|
};
|
|
10299
10243
|
|
|
10300
10244
|
const MapPresetsFormDialog = ({
|
|
@@ -10401,7 +10345,7 @@ const MapPresetsFormDialog = ({
|
|
|
10401
10345
|
onFormSubmit(parsedFormValues);
|
|
10402
10346
|
})();
|
|
10403
10347
|
};
|
|
10404
|
-
return
|
|
10348
|
+
return jsx(ConfirmationDialog, {
|
|
10405
10349
|
"data-testid": "map-preset-dialog",
|
|
10406
10350
|
title: title,
|
|
10407
10351
|
open: isOpen,
|
|
@@ -10411,7 +10355,7 @@ const MapPresetsFormDialog = ({
|
|
|
10411
10355
|
onClose: onClose,
|
|
10412
10356
|
onSubmit: onSubmit,
|
|
10413
10357
|
isLoading: isLoading,
|
|
10414
|
-
content:
|
|
10358
|
+
content: jsx(MapPresetsForm, {
|
|
10415
10359
|
formValues: formValues,
|
|
10416
10360
|
error: error,
|
|
10417
10361
|
onSubmit: onSubmit,
|
|
@@ -10421,9 +10365,11 @@ const MapPresetsFormDialog = ({
|
|
|
10421
10365
|
};
|
|
10422
10366
|
const MapPresetsFormDialogWrapper = _a => {
|
|
10423
10367
|
var props = __rest(_a, []);
|
|
10424
|
-
return
|
|
10368
|
+
return jsx(ReactHookFormProvider, Object.assign({
|
|
10425
10369
|
options: Object.assign({}, defaultFormOptions)
|
|
10426
|
-
},
|
|
10370
|
+
}, {
|
|
10371
|
+
children: jsx(MapPresetsFormDialog, Object.assign({}, props))
|
|
10372
|
+
}));
|
|
10427
10373
|
};
|
|
10428
10374
|
|
|
10429
10375
|
const MapPresetsFormDialogConnect = () => {
|
|
@@ -10447,7 +10393,7 @@ const MapPresetsFormDialogConnect = () => {
|
|
|
10447
10393
|
if (!isOpen) {
|
|
10448
10394
|
return null;
|
|
10449
10395
|
}
|
|
10450
|
-
return
|
|
10396
|
+
return jsx(MapPresetsFormDialogWrapper, Object.assign({
|
|
10451
10397
|
isOpen: isOpen,
|
|
10452
10398
|
onClose: onClose,
|
|
10453
10399
|
onSuccess: onSuccess
|
|
@@ -10515,59 +10461,65 @@ const WorkspaceDetail = ({
|
|
|
10515
10461
|
}
|
|
10516
10462
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10517
10463
|
}, []);
|
|
10518
|
-
return
|
|
10464
|
+
return jsxs(Box, Object.assign({
|
|
10519
10465
|
"data-testid": "workspace",
|
|
10520
10466
|
sx: {
|
|
10521
10467
|
width: '100%',
|
|
10522
10468
|
height: '100%'
|
|
10523
10469
|
}
|
|
10524
|
-
},
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10470
|
+
}, {
|
|
10471
|
+
children: [jsx(FetchInitialPresets, {}), isLoading && jsx(LinearProgress, {
|
|
10472
|
+
"data-testid": "loading-bar",
|
|
10473
|
+
color: "secondary",
|
|
10474
|
+
sx: {
|
|
10475
|
+
position: 'absolute',
|
|
10476
|
+
width: '100%',
|
|
10477
|
+
top: 0,
|
|
10478
|
+
zIndex: 100
|
|
10479
|
+
}
|
|
10480
|
+
}), error && error.type !== WorkspaceErrorType.SAVE && jsx(AlertBanner, Object.assign({
|
|
10481
|
+
title: t('workspace-error-fetch-detail', {
|
|
10482
|
+
WORKSPACE_ID: workspaceId
|
|
10483
|
+
}),
|
|
10484
|
+
info: error.message,
|
|
10485
|
+
shouldClose: true
|
|
10486
|
+
}, error.type === WorkspaceErrorType.GENERIC && {
|
|
10487
|
+
actionButtonProps: {
|
|
10488
|
+
title: t('workspace-retry'),
|
|
10489
|
+
onClick: () => fetchWorkspace(workspaceId)
|
|
10490
|
+
}
|
|
10491
|
+
})), children, !_isSnapshot && jsxs(Fragment, {
|
|
10492
|
+
children: [error && error.type === WorkspaceErrorType.SAVE && jsx(AlertBanner, {
|
|
10493
|
+
title: t('workspace-save-error', {
|
|
10494
|
+
TITLE: workspaceData.title
|
|
10495
|
+
}),
|
|
10496
|
+
info: error.message,
|
|
10497
|
+
shouldClose: true,
|
|
10498
|
+
actionButtonProps: {
|
|
10499
|
+
title: t('workspace-retry'),
|
|
10500
|
+
onClick: () => onSave()
|
|
10501
|
+
}
|
|
10502
|
+
}), (!error || error.type === WorkspaceErrorType.SAVE) && jsx(Box, Object.assign({
|
|
10503
|
+
component: "div",
|
|
10504
|
+
sx: {
|
|
10505
|
+
gridArea: 'content',
|
|
10506
|
+
position: 'absolute',
|
|
10507
|
+
margin: 0,
|
|
10508
|
+
padding: 0,
|
|
10509
|
+
display: 'block',
|
|
10510
|
+
height: '100%',
|
|
10511
|
+
width: '100%',
|
|
10512
|
+
overflowY: 'auto',
|
|
10513
|
+
zIndex: 3
|
|
10514
|
+
},
|
|
10515
|
+
"data-testid": "WorkspacePage"
|
|
10516
|
+
}, {
|
|
10517
|
+
children: jsx(WorkspaceViewConnect, {
|
|
10518
|
+
componentsLookUp: componentsLookUp
|
|
10519
|
+
})
|
|
10520
|
+
}))]
|
|
10521
|
+
}), jsx(MapPresetsFormDialogConnect, {})]
|
|
10522
|
+
}));
|
|
10571
10523
|
};
|
|
10572
10524
|
|
|
10573
10525
|
export { ComponentsLookUpWrapper, DemoWrapper, WorkspaceDetail, WorkspaceErrorType, WorkspaceI18nProvider, WorkspaceModuleProvider, WorkspacePresetAction, WorkspaceTopBar, WorkspaceViewConnect, WorkspaceWrapperProviderWithStore, workspaceActions as actions, createBalancedMosaicNode, createCustomEmptyMapWorkspace, defaultAuthConfig, emptyMapWorkspace, getWorkspaceRouteUrl, selectors$1 as selectors, viewPresetActions, workspaceListActions, workspaceModuleConfig, reducer$1 as workspaceReducer, routes as workspaceRoutes, workspaceTranslations };
|