@opengeoweb/workspace 13.1.0 → 13.2.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 +1516 -1442
- package/package.json +15 -15
- package/src/lib/components/WorkspaceMenu/WorkspaceMenuButton.d.ts +9 -4
- package/src/lib/components/WorkspaceMenu/WorkspaceMenuButtonConnect.d.ts +8 -2
- package/src/lib/components/WorkspaceMenu/index.d.ts +0 -1
- package/src/lib/components/WorkspaceOptions/WorkspaceOptions.d.ts +4 -10
- package/src/lib/components/WorkspaceOptions/WorkspaceOptionsConnect.d.ts +0 -2
- package/src/lib/store/viewPresets/selectors.d.ts +29 -28
package/index.esm.js
CHANGED
|
@@ -9,7 +9,7 @@ import { PROJECTION, getAxiosErrorMessage, isAxiosAuthError, isAxiosError as isA
|
|
|
9
9
|
import { snackbarTypes, snackbarActions, snackbarListener, snackbarReducer, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
10
10
|
import { isAxiosError } from 'axios';
|
|
11
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
|
-
import { ThemeWrapper, lightTheme, SharedPresetsMyUser, SharedPresetsOtherUsers, Delete, Preset, PresetWorkspace, PresetTiles, CloudLoading, CloudIdle, Link, LinkOff, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, WebAssetOff, Exclamation } from '@opengeoweb/theme';
|
|
12
|
+
import { ThemeWrapper, lightTheme, SharedPresetsMyUser, SharedPresetsOtherUsers, Delete, Preset, PresetWorkspace, PresetTiles, CloudLoading, CloudIdle, Options, Link, LinkOff, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, WebAssetOff, Exclamation } from '@opengeoweb/theme';
|
|
13
13
|
import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
|
|
14
14
|
import { useTranslation, I18nextProvider } from 'react-i18next';
|
|
15
15
|
import { AuthenticationProvider, useAuthenticationContext, GEOWEB_ROLE_PRESETS_ADMIN } from '@opengeoweb/authentication';
|
|
@@ -20,7 +20,7 @@ import { coreTranslations, CORE_NAMESPACE } from '@opengeoweb/core';
|
|
|
20
20
|
import { formFieldsTranslations, FORM_FIELDS_NAMESPACE, ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import React__default, { useCallback, useEffect } from 'react';
|
|
23
|
-
import { LinearProgress, Typography, styled, ListItemIcon, ListItem, ListItemButton, ListItemText, Grid, Box, Menu, ListSubheader, MenuItem,
|
|
23
|
+
import { LinearProgress, Typography, styled, ListItemIcon, ListItem, ListItemButton, ListItemText, Grid, Box, useTheme, Menu, ListSubheader, MenuItem, List, Checkbox, FormGroup, FormControlLabel, Tabs } from '@mui/material';
|
|
24
24
|
import 'react-mosaic-component/react-mosaic-component.css';
|
|
25
25
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
26
26
|
import { FixedSizeList } from 'react-window';
|
|
@@ -112,7 +112,8 @@ var en = {
|
|
|
112
112
|
"workspace-viewpreset-success-unshare": "View preset \"{{TITLE}}\" has been successfully unshared",
|
|
113
113
|
"workspace-loading-indicator-loading": "Loading",
|
|
114
114
|
"workspace-loading-indicator-idle": "Loaded",
|
|
115
|
-
"workspace-open-tab": "Open in new tab"
|
|
115
|
+
"workspace-open-tab": "Open in new tab",
|
|
116
|
+
"workspace-currently": "Currently"
|
|
116
117
|
};
|
|
117
118
|
var fi = {
|
|
118
119
|
"workspace-menu": "Workspace menu",
|
|
@@ -195,7 +196,8 @@ var fi = {
|
|
|
195
196
|
"workspace-viewpreset-success-share": "ei käännetty",
|
|
196
197
|
"workspace-viewpreset-success-unshare": "ei käännetty",
|
|
197
198
|
"workspace-loading-indicator-loading": "Ladataan",
|
|
198
|
-
"workspace-loading-indicator-idle": "Ladattu"
|
|
199
|
+
"workspace-loading-indicator-idle": "Ladattu",
|
|
200
|
+
"workspace-currently": "Nykyinen"
|
|
199
201
|
};
|
|
200
202
|
var no = {
|
|
201
203
|
"workspace-menu": "Arbeidsflater",
|
|
@@ -279,7 +281,8 @@ var no = {
|
|
|
279
281
|
"workspace-viewpreset-success-share": "Vinduet \"{{TITLE}}\" har blitt delt",
|
|
280
282
|
"workspace-viewpreset-success-unshare": "Vinduet \"{{TITLE}}\" deles ikke lenger",
|
|
281
283
|
"workspace-loading-indicator-loading": "Laster inn",
|
|
282
|
-
"workspace-loading-indicator-idle": "Lastet inn"
|
|
284
|
+
"workspace-loading-indicator-idle": "Lastet inn",
|
|
285
|
+
"workspace-currently": "Nåværende"
|
|
283
286
|
};
|
|
284
287
|
var nl = {
|
|
285
288
|
"workspace-menu": "Workspace menu",
|
|
@@ -366,7 +369,8 @@ var nl = {
|
|
|
366
369
|
"workspace-viewpreset-success-unshare": "niet vertaald",
|
|
367
370
|
"workspace-loading-indicator-loading": "Aan het laden",
|
|
368
371
|
"workspace-loading-indicator-idle": "Klaar met laden",
|
|
369
|
-
"workspace-open-tab": "Open in nieuw tabblad"
|
|
372
|
+
"workspace-open-tab": "Open in nieuw tabblad",
|
|
373
|
+
"workspace-currently": "Huidig"
|
|
370
374
|
};
|
|
371
375
|
var workspaceTranslations = {
|
|
372
376
|
en: en,
|
|
@@ -2079,12 +2083,13 @@ var getViewPresetsStore = function getViewPresetsStore(store) {
|
|
|
2079
2083
|
}
|
|
2080
2084
|
return initialState$2;
|
|
2081
2085
|
};
|
|
2086
|
+
var EMPTY_VIEW_PRESETS = {
|
|
2087
|
+
entities: {},
|
|
2088
|
+
ids: []
|
|
2089
|
+
};
|
|
2082
2090
|
var selectors$2 = viewPresetsAdapter.getSelectors(function (state) {
|
|
2083
2091
|
var _state$viewPresets;
|
|
2084
|
-
return (_state$viewPresets = state == null ? void 0 : state.viewPresets) != null ? _state$viewPresets :
|
|
2085
|
-
entities: {},
|
|
2086
|
-
ids: []
|
|
2087
|
-
};
|
|
2092
|
+
return (_state$viewPresets = state == null ? void 0 : state.viewPresets) != null ? _state$viewPresets : EMPTY_VIEW_PRESETS;
|
|
2088
2093
|
});
|
|
2089
2094
|
var getViewPresets = selectors$2.selectAll,
|
|
2090
2095
|
getViewPresetById = selectors$2.selectById;
|
|
@@ -6862,1561 +6867,1548 @@ var ViewPresetMenu = function ViewPresetMenu(_ref) {
|
|
|
6862
6867
|
});
|
|
6863
6868
|
};
|
|
6864
6869
|
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
setAnchorEl = _React$useState[1];
|
|
6889
|
-
var isOpen = Boolean(anchorEl);
|
|
6890
|
-
var handleClick = function handleClick(event) {
|
|
6891
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
6892
|
-
};
|
|
6893
|
-
React.useEffect(function () {
|
|
6894
|
-
if (isDefaultOpen) {
|
|
6895
|
-
setAnchorEl(document.getElementById(id));
|
|
6896
|
-
}
|
|
6897
|
-
}, [isDefaultOpen, id]);
|
|
6898
|
-
var options = [{
|
|
6899
|
-
title: t('workspace-save'),
|
|
6900
|
-
callback: handleSave
|
|
6901
|
-
}, {
|
|
6902
|
-
title: t('workspace-save-as'),
|
|
6903
|
-
callback: handleSaveAs
|
|
6904
|
-
}, {
|
|
6905
|
-
title: t('workspace-edit'),
|
|
6906
|
-
callback: handleEdit
|
|
6907
|
-
}, {
|
|
6908
|
-
title: t('workspace-reset'),
|
|
6909
|
-
callback: handleReset
|
|
6910
|
-
}, {
|
|
6911
|
-
title: t('workspace-delete'),
|
|
6912
|
-
callback: handleDelete
|
|
6913
|
-
}];
|
|
6914
|
-
var renderButton = function renderButton() {
|
|
6915
|
-
return jsxs(CustomToggleButton, {
|
|
6916
|
-
variant: "tool",
|
|
6917
|
-
selected: isOpen,
|
|
6918
|
-
onClick: handleClick,
|
|
6919
|
-
id: id,
|
|
6920
|
-
"data-testid": id,
|
|
6921
|
-
disableRipple: true,
|
|
6922
|
-
disabled: isDisabled,
|
|
6923
|
-
sx: {
|
|
6924
|
-
fontSize: '12px',
|
|
6925
|
-
'&&': {
|
|
6926
|
-
color: activeTab && !isOpen ? 'geowebColors.buttons.icon.active.color' : undefined,
|
|
6927
|
-
backgroundColor: !isOpen ? 'transparent' : undefined,
|
|
6928
|
-
'&:hover': {
|
|
6929
|
-
color: activeTab ? 'geowebColors.buttons.icon.active.color' : 'inherit',
|
|
6930
|
-
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
6931
|
-
},
|
|
6932
|
-
paddingRight: '4px !important',
|
|
6933
|
-
display: 'block',
|
|
6934
|
-
width: '100%',
|
|
6935
|
-
height: 20,
|
|
6936
|
-
fontStyle: hasChanges ? 'italic' : undefined,
|
|
6937
|
-
fontWeight: 500,
|
|
6938
|
-
textOverflow: 'ellipsis',
|
|
6939
|
-
overflow: 'hidden',
|
|
6940
|
-
whiteSpace: 'nowrap',
|
|
6941
|
-
lineHeight: '1px',
|
|
6942
|
-
textAlign: 'left',
|
|
6943
|
-
textTransform: 'none',
|
|
6944
|
-
'&.MuiButtonBase-root': {
|
|
6945
|
-
paddingLeft: 1,
|
|
6946
|
-
paddingTop: 1,
|
|
6947
|
-
paddingBottom: 1,
|
|
6948
|
-
border: 'none'
|
|
6949
|
-
}
|
|
6950
|
-
}
|
|
6951
|
-
},
|
|
6952
|
-
role: "button",
|
|
6953
|
-
children: [title, panelId && jsx(Box, {
|
|
6954
|
-
component: "span",
|
|
6955
|
-
sx: {
|
|
6956
|
-
fontStyle: 'normal',
|
|
6957
|
-
marginLeft: 1,
|
|
6958
|
-
color: 'geowebColors.captions.captionStatus.rgba'
|
|
6959
|
-
},
|
|
6960
|
-
children: panelId
|
|
6961
|
-
}), jsxs(Menu, {
|
|
6962
|
-
BackdropProps: {
|
|
6963
|
-
style: {
|
|
6964
|
-
opacity: 0,
|
|
6965
|
-
transition: 'none'
|
|
6966
|
-
}
|
|
6967
|
-
},
|
|
6968
|
-
open: isOpen,
|
|
6969
|
-
anchorEl: anchorEl,
|
|
6970
|
-
anchorOrigin: {
|
|
6971
|
-
vertical: 21,
|
|
6972
|
-
horizontal: 6
|
|
6973
|
-
},
|
|
6974
|
-
sx: {
|
|
6975
|
-
'& .MuiMenu-list': {
|
|
6976
|
-
padding: 0
|
|
6977
|
-
},
|
|
6978
|
-
'& .MuiMenuItem-root': {
|
|
6979
|
-
fontSize: 16
|
|
6980
|
-
}
|
|
6981
|
-
},
|
|
6982
|
-
children: [jsx(ListSubheader, {
|
|
6983
|
-
sx: {
|
|
6984
|
-
paddingTop: '8px'
|
|
6985
|
-
},
|
|
6986
|
-
children: jsx(Typography, {
|
|
6987
|
-
sx: {
|
|
6988
|
-
letterSpacing: '0.4px',
|
|
6989
|
-
fontSize: 12
|
|
6990
|
-
},
|
|
6991
|
-
children: t('workspace-options')
|
|
6992
|
-
})
|
|
6993
|
-
}), options.map(function (_ref2) {
|
|
6994
|
-
var title = _ref2.title,
|
|
6995
|
-
callback = _ref2.callback;
|
|
6996
|
-
return jsx(MenuItem, {
|
|
6997
|
-
onClick: callback,
|
|
6998
|
-
disabled: !callback,
|
|
6999
|
-
children: title
|
|
7000
|
-
}, title);
|
|
7001
|
-
})]
|
|
7002
|
-
})]
|
|
7003
|
-
});
|
|
7004
|
-
};
|
|
7005
|
-
return isDisabled ? renderButton() : jsx(CustomTooltip, {
|
|
7006
|
-
title: !isOpen && title,
|
|
7007
|
-
TransitionProps: {
|
|
7008
|
-
exit: false
|
|
7009
|
-
},
|
|
7010
|
-
children: renderButton()
|
|
7011
|
-
});
|
|
6870
|
+
/* *
|
|
6871
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6872
|
+
* you may not use this file except in compliance with the License.
|
|
6873
|
+
* You may obtain a copy of the License at
|
|
6874
|
+
*
|
|
6875
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6876
|
+
*
|
|
6877
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6878
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6879
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6880
|
+
* See the License for the specific language governing permissions and
|
|
6881
|
+
* limitations under the License.
|
|
6882
|
+
*
|
|
6883
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6884
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
6885
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
6886
|
+
* */
|
|
6887
|
+
var config = sessionStorageProvider.getConfig();
|
|
6888
|
+
var presetBaseUrl = (config == null ? void 0 : config.GW_PRESET_BACKEND_URL) || '';
|
|
6889
|
+
var getWorkspace = function getWorkspace(workspaceId, auth) {
|
|
6890
|
+
return fetch(presetBaseUrl + "/workspacepreset/" + workspaceId, {
|
|
6891
|
+
headers: getHeaders(auth)
|
|
6892
|
+
}).then(handleResponse);
|
|
7012
6893
|
};
|
|
7013
|
-
var
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
return loadingIndicatorSelectors.isLoading(store, panelId);
|
|
7019
|
-
});
|
|
7020
|
-
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7021
|
-
t = _useWorkspaceTranslat.t;
|
|
7022
|
-
return jsx(CustomTooltip, {
|
|
7023
|
-
title: isLoading ? t('workspace-loading-indicator-loading') : t('workspace-loading-indicator-idle'),
|
|
7024
|
-
children: jsx("span", {
|
|
7025
|
-
style: {
|
|
7026
|
-
height: '100%'
|
|
7027
|
-
},
|
|
7028
|
-
children: isLoading ? jsx(CloudLoading, {
|
|
7029
|
-
"data-testid": "cloudicon-loading",
|
|
7030
|
-
style: {
|
|
7031
|
-
fill: '#186DFF'
|
|
7032
|
-
}
|
|
7033
|
-
}) : jsx(CloudIdle, {
|
|
7034
|
-
"data-testid": "cloudicon-idle"
|
|
7035
|
-
})
|
|
7036
|
-
})
|
|
7037
|
-
});
|
|
6894
|
+
var deleteWorkspace = function deleteWorkspace(workspaceId, auth) {
|
|
6895
|
+
return fetch(presetBaseUrl + "/workspacepreset/" + workspaceId, {
|
|
6896
|
+
headers: getHeaders(auth),
|
|
6897
|
+
method: 'DELETE'
|
|
6898
|
+
}).then(handleResponse);
|
|
7038
6899
|
};
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
'&&': {
|
|
7046
|
-
backgroundColor: !isViewPresetDialogOpen ? 'transparent' : undefined,
|
|
7047
|
-
'&:hover': {
|
|
7048
|
-
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
7049
|
-
},
|
|
7050
|
-
'.MuiSvgIcon-root > path': {
|
|
7051
|
-
fill: isViewPresetDialogOpen ? theme.palette.geowebColors.iconButtons.tool.active.color : undefined
|
|
7052
|
-
}
|
|
7053
|
-
}
|
|
7054
|
-
};
|
|
6900
|
+
var updateWorkspace = function updateWorkspace(workspaceId, data, auth) {
|
|
6901
|
+
return fetch(presetBaseUrl + "/workspacepreset/" + workspaceId, {
|
|
6902
|
+
headers: getHeaders(auth),
|
|
6903
|
+
method: 'PUT',
|
|
6904
|
+
body: JSON.stringify(data)
|
|
6905
|
+
}).then(handleResponse);
|
|
7055
6906
|
};
|
|
7056
|
-
var
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
6907
|
+
var createWorkspace = function createWorkspace(data, auth) {
|
|
6908
|
+
return fetch(presetBaseUrl + "/workspacepreset", {
|
|
6909
|
+
headers: getHeaders(auth),
|
|
6910
|
+
method: 'POST',
|
|
6911
|
+
body: JSON.stringify(data)
|
|
6912
|
+
}).then(handleResponse);
|
|
6913
|
+
};
|
|
6914
|
+
|
|
6915
|
+
var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
|
|
6916
|
+
var _GENERIC$AUTH$error$c;
|
|
7064
6917
|
var _useAuthenticationCon = useAuthenticationContext(),
|
|
7065
6918
|
currentRole = _useAuthenticationCon.currentRole,
|
|
7066
6919
|
isLoggedIn = _useAuthenticationCon.isLoggedIn,
|
|
7067
6920
|
auth = _useAuthenticationCon.auth;
|
|
6921
|
+
var username = (auth == null ? void 0 : auth.username) || '';
|
|
7068
6922
|
var isAdmin = (currentRole == null ? void 0 : currentRole.name) === GEOWEB_ROLE_PRESETS_ADMIN.name;
|
|
7069
|
-
var
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
title = _ref2.title,
|
|
7073
|
-
scope = _ref2.scope,
|
|
7074
|
-
restProps = _objectWithoutPropertiesLoose(_ref2, _excluded$4);
|
|
7075
|
-
return Object.assign({
|
|
7076
|
-
title: title,
|
|
7077
|
-
scope: scope
|
|
7078
|
-
}, restProps);
|
|
7079
|
-
}, shallowEqual);
|
|
7080
|
-
var viewComponentType = useSelector(function (store) {
|
|
7081
|
-
return getViewComponentType(store, panelId);
|
|
6923
|
+
var scope = !isAdmin ? 'user' : 'system';
|
|
6924
|
+
var workspacePresets = useSelector(function (store) {
|
|
6925
|
+
return getWorkspaceList(store);
|
|
7082
6926
|
});
|
|
7083
|
-
var
|
|
7084
|
-
|
|
6927
|
+
var selectedFilters = useSelector(getWorkspaceListFilters);
|
|
6928
|
+
var filteredPresets = React.useMemo(function () {
|
|
6929
|
+
return filterAndSortPresets(workspacePresets, selectedFilters, username, isAdmin);
|
|
6930
|
+
}, [workspacePresets, selectedFilters, username, isAdmin]);
|
|
6931
|
+
var currentView = useSelector(function (store) {
|
|
6932
|
+
return getWorkspaceState(store);
|
|
7085
6933
|
});
|
|
7086
|
-
var
|
|
7087
|
-
return
|
|
6934
|
+
var workspaceListFilters = useSelector(function (store) {
|
|
6935
|
+
return getWorkspaceListFilters(store, scope, isAdmin);
|
|
7088
6936
|
});
|
|
7089
|
-
var
|
|
7090
|
-
return
|
|
6937
|
+
var workspaceSearchQuery = useSelector(function (store) {
|
|
6938
|
+
return getWorkspaceListSearchQuery(store);
|
|
7091
6939
|
});
|
|
7092
|
-
var
|
|
7093
|
-
return
|
|
6940
|
+
var isFetching = useSelector(function (store) {
|
|
6941
|
+
return getIsWorkspaceListFetching(store);
|
|
7094
6942
|
});
|
|
7095
|
-
var
|
|
7096
|
-
|
|
7097
|
-
var title = workspaceView.title || t('workspace-mappreset-new');
|
|
7098
|
-
var viewScope = workspaceView.scope;
|
|
7099
|
-
var fullTitle = getPresetTitle(title, hasViewPresetChanges, isNewActive, t);
|
|
7100
|
-
var openViewPresetsDialog = React.useCallback(function (viewPresetDialogOptions) {
|
|
7101
|
-
dispatch(viewPresetActions.openViewPresetDialog({
|
|
7102
|
-
viewPresetDialog: viewPresetDialogOptions
|
|
7103
|
-
}));
|
|
7104
|
-
}, [dispatch]);
|
|
7105
|
-
var currentWarningsPreset = useSelector(function (store) {
|
|
7106
|
-
return publicWarningsSelectors.getWarningsPresetById(store, panelId);
|
|
6943
|
+
var error = useSelector(function (store) {
|
|
6944
|
+
return getWorkspaceListError(store);
|
|
7107
6945
|
});
|
|
7108
|
-
var
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
};
|
|
7119
|
-
default:
|
|
7120
|
-
return undefined;
|
|
7121
|
-
}
|
|
7122
|
-
}, [currentWarningsPreset, panelId, relatedSyncGroupIds, store, viewComponentType]);
|
|
7123
|
-
var onSave = React.useCallback(function () {
|
|
7124
|
-
dispatch(viewPresetActions.saveViewPreset({
|
|
7125
|
-
panelId: panelId,
|
|
7126
|
-
viewPresetId: activeViewPresetId,
|
|
7127
|
-
viewPreset: Object.assign({}, emptyViewPreset(viewComponentType), {
|
|
7128
|
-
title: title,
|
|
7129
|
-
initialProps: constructInitialProps()
|
|
7130
|
-
})
|
|
6946
|
+
var dispatch = useDispatch();
|
|
6947
|
+
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
6948
|
+
t = _useWorkspaceTranslat.t;
|
|
6949
|
+
var fetchWorkspaceList = React.useCallback(function () {
|
|
6950
|
+
var filterParams = constructFilterParams([], workspaceSearchQuery);
|
|
6951
|
+
dispatch(workspaceListActions.fetchWorkspaceList(filterParams));
|
|
6952
|
+
}, [dispatch, workspaceSearchQuery]);
|
|
6953
|
+
var fetchWorkspace = React.useCallback(function (workspaceId) {
|
|
6954
|
+
dispatch(workspaceActions.fetchWorkspace({
|
|
6955
|
+
workspaceId: workspaceId
|
|
7131
6956
|
}));
|
|
7132
|
-
}, [
|
|
7133
|
-
var
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
"abstract": presetAbstract
|
|
7142
|
-
}
|
|
7143
|
-
});
|
|
7144
|
-
}, [activeViewPresetId, openViewPresetsDialog, panelId, title, presetAbstract, t]);
|
|
7145
|
-
var onSaveAs = React.useCallback(function () {
|
|
7146
|
-
var formTitle = activeViewPresetId ? title : '';
|
|
7147
|
-
openViewPresetsDialog({
|
|
7148
|
-
title: t('workspace-mappreset-save-as'),
|
|
7149
|
-
action: PresetAction.SAVE_AS,
|
|
7150
|
-
viewPresetId: activeViewPresetId,
|
|
7151
|
-
panelId: panelId,
|
|
7152
|
-
formValues: {
|
|
7153
|
-
title: formTitle,
|
|
7154
|
-
initialProps: constructInitialProps(),
|
|
7155
|
-
"abstract": presetAbstract
|
|
7156
|
-
}
|
|
7157
|
-
});
|
|
7158
|
-
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title, presetAbstract]);
|
|
7159
|
-
var onEdit = React.useCallback(function () {
|
|
7160
|
-
var formTitle = activeViewPresetId ? title : '';
|
|
7161
|
-
openViewPresetsDialog({
|
|
7162
|
-
title: t('workspace-mappreset-dialog-title-edit'),
|
|
7163
|
-
action: PresetAction.EDIT,
|
|
7164
|
-
panelId: panelId,
|
|
7165
|
-
viewPresetId: activeViewPresetId,
|
|
7166
|
-
formValues: {
|
|
7167
|
-
title: formTitle,
|
|
7168
|
-
initialProps: constructInitialProps(),
|
|
7169
|
-
"abstract": presetAbstract
|
|
7170
|
-
}
|
|
7171
|
-
});
|
|
7172
|
-
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title, presetAbstract]);
|
|
7173
|
-
var onReset = React.useCallback(function () {
|
|
7174
|
-
openViewPresetsDialog({
|
|
7175
|
-
title: t('workspace-reset-title'),
|
|
7176
|
-
action: PresetAction.RESET,
|
|
7177
|
-
viewPresetId: activeViewPresetId,
|
|
7178
|
-
panelId: panelId,
|
|
7179
|
-
formValues: {
|
|
7180
|
-
title: title
|
|
7181
|
-
}
|
|
7182
|
-
});
|
|
7183
|
-
}, [activeViewPresetId, openViewPresetsDialog, panelId, t, title]);
|
|
7184
|
-
var toggleViewPresetDialog = React.useCallback(function (_ref3) {
|
|
7185
|
-
var panelId = _ref3.panelId,
|
|
7186
|
-
isViewPresetDialogOpen = _ref3.isViewPresetDialogOpen;
|
|
7187
|
-
dispatch(viewPresetActions.toggleViewPresetListDialog({
|
|
7188
|
-
panelId: panelId,
|
|
7189
|
-
isViewPresetListDialogOpen: isViewPresetDialogOpen
|
|
6957
|
+
}, [dispatch]);
|
|
6958
|
+
var setWorkspaceActionDialogOptions = React.useCallback(function (dialogOptions) {
|
|
6959
|
+
dispatch(workspaceListActions.openWorkspaceActionDialogOptions(dialogOptions));
|
|
6960
|
+
}, [dispatch]);
|
|
6961
|
+
var toggleSelectFilterChip = React.useCallback(function (id, isSelected) {
|
|
6962
|
+
dispatch(workspaceListActions.toggleSelectFilterChip({
|
|
6963
|
+
id: id,
|
|
6964
|
+
isSelected: isSelected,
|
|
6965
|
+
isAdmin: isAdmin
|
|
7190
6966
|
}));
|
|
6967
|
+
}, [dispatch, isAdmin]);
|
|
6968
|
+
var setSelectAllFilterChip = React.useCallback(function () {
|
|
6969
|
+
dispatch(workspaceListActions.setSelectAllFilterChip());
|
|
7191
6970
|
}, [dispatch]);
|
|
7192
|
-
var
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
6971
|
+
var searchFilter = React.useCallback(function (searchQuery) {
|
|
6972
|
+
dispatch(workspaceListActions.searchFilter({
|
|
6973
|
+
searchQuery: searchQuery
|
|
6974
|
+
}));
|
|
6975
|
+
}, [dispatch]);
|
|
6976
|
+
// If we're loading the `New workspace` preset as defined in the FE, use this instead of retrieving from BE
|
|
6977
|
+
var onClickNewPreset = React.useCallback(function () {
|
|
6978
|
+
dispatch(routerActions.navigateToUrl({
|
|
6979
|
+
url: getWorkspaceRouteUrl()
|
|
6980
|
+
}));
|
|
6981
|
+
dispatch(workspaceListActions.toggleWorkspaceDialog({
|
|
6982
|
+
isWorkspaceListDialogOpen: false
|
|
6983
|
+
}));
|
|
6984
|
+
dispatch(workspaceActions.changeToEmptyMapWorkspace({
|
|
6985
|
+
newMapPresetText: t('workspace-mappreset-new'),
|
|
6986
|
+
newWorkspaceText: t('workspace-new')
|
|
6987
|
+
}));
|
|
6988
|
+
}, [dispatch, t]);
|
|
6989
|
+
var onClickWorkspacePreset = function onClickWorkspacePreset(id) {
|
|
6990
|
+
if (id === getEmptyMapWorkspace(t).id) {
|
|
6991
|
+
onClickNewPreset();
|
|
6992
|
+
} else if (!isFetching) {
|
|
6993
|
+
fetchWorkspace(id);
|
|
6994
|
+
}
|
|
6995
|
+
};
|
|
6996
|
+
var onClickFilterChip = function onClickFilterChip(id, shouldSelect) {
|
|
6997
|
+
if (id === 'all') {
|
|
6998
|
+
if (shouldSelect) {
|
|
6999
|
+
setSelectAllFilterChip();
|
|
7000
|
+
}
|
|
7001
|
+
} else {
|
|
7002
|
+
toggleSelectFilterChip(id, shouldSelect);
|
|
7003
|
+
}
|
|
7004
|
+
};
|
|
7005
|
+
var onClickWorkspacePresetOption = function onClickWorkspacePresetOption(presetId, workspaceAction) {
|
|
7006
|
+
// If affectedPreset is the FE defined `New workspace` - use the definition from FE instead of BE
|
|
7007
|
+
var affectedPreset = presetId === getEmptyMapWorkspace(t).id ? getEmptyMapWorkspace(t) : workspacePresets.find(function (preset) {
|
|
7008
|
+
return preset.id === presetId;
|
|
7196
7009
|
});
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7010
|
+
var presetTitle = affectedPreset == null ? void 0 : affectedPreset.title;
|
|
7011
|
+
switch (workspaceAction) {
|
|
7012
|
+
case WorkspacePresetAction.DUPLICATE:
|
|
7013
|
+
case WorkspacePresetAction.EDIT:
|
|
7014
|
+
{
|
|
7015
|
+
setWorkspaceActionDialogOptions({
|
|
7016
|
+
action: workspaceAction,
|
|
7017
|
+
presetId: presetId,
|
|
7018
|
+
formValues: {
|
|
7019
|
+
title: presetTitle,
|
|
7020
|
+
"abstract": affectedPreset["abstract"],
|
|
7021
|
+
scope: scope
|
|
7022
|
+
}
|
|
7023
|
+
});
|
|
7024
|
+
break;
|
|
7025
|
+
}
|
|
7026
|
+
// case WorkspacePresetAction.SAVE: {
|
|
7027
|
+
// break;
|
|
7028
|
+
// }
|
|
7029
|
+
case WorkspacePresetAction.DELETE:
|
|
7030
|
+
{
|
|
7031
|
+
setWorkspaceActionDialogOptions({
|
|
7032
|
+
action: workspaceAction,
|
|
7033
|
+
presetId: presetId,
|
|
7034
|
+
formValues: {
|
|
7035
|
+
title: presetTitle,
|
|
7036
|
+
scope: scope
|
|
7037
|
+
}
|
|
7038
|
+
});
|
|
7039
|
+
break;
|
|
7040
|
+
}
|
|
7041
|
+
case WorkspacePresetAction.DELETE_SYSTEM_PRESET:
|
|
7042
|
+
{
|
|
7043
|
+
setWorkspaceActionDialogOptions({
|
|
7044
|
+
action: workspaceAction,
|
|
7045
|
+
presetId: presetId,
|
|
7046
|
+
formValues: {
|
|
7047
|
+
title: presetTitle,
|
|
7048
|
+
scope: scope
|
|
7049
|
+
}
|
|
7050
|
+
});
|
|
7051
|
+
break;
|
|
7052
|
+
}
|
|
7053
|
+
case WorkspacePresetAction.SHARE:
|
|
7054
|
+
{
|
|
7055
|
+
void getWorkspace(presetId, auth).then(function (preset) {
|
|
7056
|
+
return updateWorkspace(presetId, Object.assign({}, preset, {
|
|
7057
|
+
is_shared: !preset.is_shared
|
|
7058
|
+
}), auth).then(function () {
|
|
7059
|
+
dispatch(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
7060
|
+
workspaceId: presetId,
|
|
7061
|
+
action: WorkspacePresetAction.SHARE,
|
|
7062
|
+
title: presetTitle,
|
|
7063
|
+
scope: scope,
|
|
7064
|
+
is_shared: preset.is_shared
|
|
7065
|
+
}));
|
|
7066
|
+
fetchWorkspaceList();
|
|
7067
|
+
})["catch"](function (error) {
|
|
7068
|
+
dispatch(workspaceListActions.onErrorWorkspacePresetAction({
|
|
7069
|
+
error: {
|
|
7070
|
+
message: "" + error,
|
|
7071
|
+
type: WorkspaceListErrorType.VERBATIM_ERROR,
|
|
7072
|
+
category: WorkspaceListErrorCategory.GENERIC
|
|
7073
|
+
}
|
|
7074
|
+
}));
|
|
7075
|
+
});
|
|
7076
|
+
});
|
|
7077
|
+
break;
|
|
7078
|
+
}
|
|
7079
|
+
case WorkspacePresetAction.OPEN_TAB:
|
|
7080
|
+
{
|
|
7081
|
+
var url = getWorkspaceRouteUrl(presetId);
|
|
7082
|
+
window.open(url, '_blank');
|
|
7083
|
+
break;
|
|
7084
|
+
}
|
|
7085
|
+
}
|
|
7086
|
+
};
|
|
7087
|
+
var isAllSelected = workspaceListFilters.length > 0 && workspaceListFilters.every(function (filter) {
|
|
7088
|
+
return filter.isSelected;
|
|
7089
|
+
});
|
|
7090
|
+
var shouldHideNewWorkspace = !isAllSelected || workspaceSearchQuery.length > 0;
|
|
7091
|
+
return jsxs(Box, {
|
|
7092
|
+
"data-testid": "workspace-selectlist-connect",
|
|
7093
|
+
style: {
|
|
7094
|
+
display: 'flex',
|
|
7095
|
+
flexDirection: 'column',
|
|
7096
|
+
height: '100%'
|
|
7097
|
+
},
|
|
7098
|
+
tabIndex: 0,
|
|
7099
|
+
children: [isFetching && jsx(LinearProgress, {
|
|
7100
|
+
"data-testid": "loading-bar",
|
|
7101
|
+
color: "secondary",
|
|
7102
|
+
sx: {
|
|
7103
|
+
position: 'absolute',
|
|
7104
|
+
width: '100%',
|
|
7105
|
+
top: 0,
|
|
7106
|
+
left: 0
|
|
7107
|
+
}
|
|
7108
|
+
}), error && jsx("div", {
|
|
7109
|
+
style: {
|
|
7110
|
+
whiteSpace: 'normal'
|
|
7111
|
+
},
|
|
7112
|
+
children: jsx(AlertBanner, Object.assign({
|
|
7113
|
+
title: (_GENERIC$AUTH$error$c = {
|
|
7114
|
+
GENERIC: '',
|
|
7115
|
+
AUTH: t('workspace-error-auth')
|
|
7116
|
+
}[error.category]) != null ? _GENERIC$AUTH$error$c : t('workspace-error-fetch'),
|
|
7117
|
+
info: error.type === WorkspaceListErrorType.TRANSLATABLE_ERROR ? t(error.key, error.params) : error.message,
|
|
7118
|
+
shouldClose: true
|
|
7119
|
+
}, error.category === WorkspaceListErrorCategory.GENERIC && {
|
|
7120
|
+
actionButtonProps: {
|
|
7121
|
+
title: t('workspace-retry'),
|
|
7122
|
+
onClick: function onClick() {
|
|
7123
|
+
return fetchWorkspaceList();
|
|
7124
|
+
}
|
|
7125
|
+
}
|
|
7126
|
+
}))
|
|
7127
|
+
}), jsxs(Box, {
|
|
7214
7128
|
sx: {
|
|
7215
7129
|
display: 'flex',
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7130
|
+
flexDirection: 'column',
|
|
7131
|
+
height: '100%',
|
|
7132
|
+
padding: 1,
|
|
7133
|
+
overflow: 'hidden'
|
|
7220
7134
|
},
|
|
7221
|
-
children: [
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7135
|
+
children: [!error && jsxs(Box, {
|
|
7136
|
+
sx: {
|
|
7137
|
+
marginBottom: 1
|
|
7138
|
+
},
|
|
7139
|
+
children: [jsx(Box, {
|
|
7140
|
+
sx: {
|
|
7141
|
+
display: 'flex',
|
|
7142
|
+
width: '100%'
|
|
7143
|
+
},
|
|
7144
|
+
children: jsx(Filter, {
|
|
7145
|
+
filters: workspaceListFilters,
|
|
7146
|
+
onClickFilterChip: onClickFilterChip,
|
|
7147
|
+
isAllSelected: isAllSelected,
|
|
7148
|
+
searchQuery: workspaceSearchQuery,
|
|
7149
|
+
onSearch: searchFilter
|
|
7150
|
+
})
|
|
7151
|
+
}), jsx(Box, {
|
|
7152
|
+
sx: {
|
|
7153
|
+
display: 'flex',
|
|
7154
|
+
justifyContent: 'flex-start'
|
|
7155
|
+
},
|
|
7156
|
+
children: jsx(LastUpdateTime, {
|
|
7157
|
+
onPressRefresh: function onPressRefresh() {
|
|
7158
|
+
return fetchWorkspaceList();
|
|
7159
|
+
},
|
|
7160
|
+
hideLabel: true
|
|
7161
|
+
})
|
|
7162
|
+
})]
|
|
7239
7163
|
}), jsx(Box, {
|
|
7240
7164
|
sx: {
|
|
7241
|
-
|
|
7165
|
+
flexGrow: 1,
|
|
7166
|
+
minHeight: 0
|
|
7167
|
+
},
|
|
7168
|
+
children: jsx(WorkspaceSelectList, {
|
|
7169
|
+
workspacePresets: filteredPresets,
|
|
7170
|
+
currentSelectedId: currentView.id || '',
|
|
7171
|
+
onClickWorkspacePreset: onClickWorkspacePreset,
|
|
7172
|
+
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
7173
|
+
hideNewWorkspace: shouldHideNewWorkspace,
|
|
7174
|
+
isEditable: isLoggedIn,
|
|
7175
|
+
isAdmin: isAdmin,
|
|
7176
|
+
searchQuery: workspaceSearchQuery
|
|
7177
|
+
})
|
|
7178
|
+
})]
|
|
7179
|
+
})]
|
|
7180
|
+
});
|
|
7181
|
+
};
|
|
7182
|
+
|
|
7183
|
+
var WorkspaceMenu = function WorkspaceMenu(_ref) {
|
|
7184
|
+
var _ref$isOpen = _ref.isOpen,
|
|
7185
|
+
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
|
7186
|
+
closeMenu = _ref.closeMenu;
|
|
7187
|
+
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7188
|
+
t = _useWorkspaceTranslat.t;
|
|
7189
|
+
return jsx(CustomDialog, {
|
|
7190
|
+
open: isOpen,
|
|
7191
|
+
onClose: function onClose() {
|
|
7192
|
+
if (closeMenu) {
|
|
7193
|
+
closeMenu();
|
|
7194
|
+
}
|
|
7195
|
+
},
|
|
7196
|
+
isResizable: true,
|
|
7197
|
+
hasLayout: false,
|
|
7198
|
+
resizableDefaultSize: {
|
|
7199
|
+
width: 380,
|
|
7200
|
+
height: '90%'
|
|
7201
|
+
},
|
|
7202
|
+
slotProps: {
|
|
7203
|
+
backdrop: {
|
|
7204
|
+
style: {
|
|
7205
|
+
top: 40
|
|
7206
|
+
}
|
|
7207
|
+
},
|
|
7208
|
+
root: {
|
|
7209
|
+
style: {
|
|
7210
|
+
top: 40
|
|
7211
|
+
}
|
|
7212
|
+
}
|
|
7213
|
+
},
|
|
7214
|
+
"data-testid": "workspace-menu",
|
|
7215
|
+
children: jsx(ToolContainer, {
|
|
7216
|
+
title: t('workspace-menu'),
|
|
7217
|
+
onClose: closeMenu,
|
|
7218
|
+
style: {
|
|
7219
|
+
width: '100%',
|
|
7220
|
+
height: '100%'
|
|
7221
|
+
},
|
|
7222
|
+
onClick: function onClick(event) {
|
|
7223
|
+
event.stopPropagation();
|
|
7224
|
+
},
|
|
7225
|
+
children: jsx(WorkspaceSelectListConnect, {})
|
|
7226
|
+
})
|
|
7227
|
+
});
|
|
7228
|
+
};
|
|
7229
|
+
|
|
7230
|
+
var workspacePresetOptionId = 'workspaceMenuButton';
|
|
7231
|
+
var viewPresetOptionId = 'viewpreset-options-toolbutton';
|
|
7232
|
+
var WorkspaceMenuButton = function WorkspaceMenuButton(_ref) {
|
|
7233
|
+
var title = _ref.title,
|
|
7234
|
+
activeTab = _ref.activeTab,
|
|
7235
|
+
_ref$hasChanges = _ref.hasChanges,
|
|
7236
|
+
hasChanges = _ref$hasChanges === void 0 ? false : _ref$hasChanges,
|
|
7237
|
+
_ref$id = _ref.id,
|
|
7238
|
+
id = _ref$id === void 0 ? workspacePresetOptionId : _ref$id,
|
|
7239
|
+
_ref$showMenu = _ref.showMenu,
|
|
7240
|
+
showMenu = _ref$showMenu === void 0 ? false : _ref$showMenu,
|
|
7241
|
+
onToggleDialog = _ref.onToggleDialog;
|
|
7242
|
+
var handleClick = function handleClick() {
|
|
7243
|
+
if (onToggleDialog) {
|
|
7244
|
+
onToggleDialog(!showMenu);
|
|
7245
|
+
}
|
|
7246
|
+
};
|
|
7247
|
+
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7248
|
+
t = _useWorkspaceTranslat.t;
|
|
7249
|
+
return jsxs(Box, {
|
|
7250
|
+
sx: {
|
|
7251
|
+
display: 'flex',
|
|
7252
|
+
alignItems: 'center',
|
|
7253
|
+
flexGrow: 1,
|
|
7254
|
+
minWidth: 0
|
|
7255
|
+
},
|
|
7256
|
+
children: [jsx(CustomTooltip, {
|
|
7257
|
+
title: !showMenu && jsxs(Fragment, {
|
|
7258
|
+
children: [jsx(Box, {
|
|
7259
|
+
component: "span",
|
|
7260
|
+
sx: {
|
|
7261
|
+
fontWeight: 'bold',
|
|
7262
|
+
display: 'block'
|
|
7263
|
+
},
|
|
7264
|
+
children: t('workspace-menu')
|
|
7265
|
+
}), jsx(Box, {
|
|
7266
|
+
component: "span",
|
|
7267
|
+
children: t('workspace-currently') + ": " + title
|
|
7268
|
+
})]
|
|
7269
|
+
}),
|
|
7270
|
+
TransitionProps: {
|
|
7271
|
+
exit: false
|
|
7272
|
+
},
|
|
7273
|
+
children: jsx(CustomToggleButton, {
|
|
7274
|
+
variant: "tool",
|
|
7275
|
+
selected: showMenu,
|
|
7276
|
+
onClick: handleClick,
|
|
7277
|
+
"data-testid": id,
|
|
7278
|
+
"aria-label": "workspace menu",
|
|
7279
|
+
disableRipple: true,
|
|
7280
|
+
sx: {
|
|
7281
|
+
flexGrow: 1,
|
|
7282
|
+
// expand across the row
|
|
7283
|
+
flexShrink: 1,
|
|
7284
|
+
minWidth: 0,
|
|
7285
|
+
justifyContent: 'flex-start',
|
|
7286
|
+
alignItems: 'center',
|
|
7287
|
+
textAlign: 'left',
|
|
7288
|
+
fontSize: '12px',
|
|
7289
|
+
fontWeight: 500,
|
|
7290
|
+
fontStyle: hasChanges ? 'italic' : undefined,
|
|
7291
|
+
height: 20,
|
|
7292
|
+
maxHeight: 20,
|
|
7293
|
+
overflow: 'hidden',
|
|
7294
|
+
'&&': {
|
|
7295
|
+
color: activeTab && !showMenu ? 'geowebColors.buttons.icon.active.color' : 'geowebColors.buttons.icon.active.color',
|
|
7296
|
+
textTransform: 'none',
|
|
7297
|
+
backgroundColor: !showMenu ? 'transparent' : 'geowebColors.workspace.tabButtonHover',
|
|
7298
|
+
'&:hover': {
|
|
7299
|
+
backgroundColor: 'geowebColors.workspace.tabButtonHover',
|
|
7300
|
+
color: activeTab && showMenu ? 'white' : 'geowebColors.buttons.icon.active.color'
|
|
7301
|
+
}
|
|
7302
|
+
}
|
|
7242
7303
|
},
|
|
7243
|
-
children: jsx(
|
|
7244
|
-
|
|
7304
|
+
children: jsx(Box, {
|
|
7305
|
+
component: "span",
|
|
7306
|
+
sx: {
|
|
7307
|
+
flexGrow: 1,
|
|
7308
|
+
flexShrink: 1,
|
|
7309
|
+
minWidth: 0,
|
|
7310
|
+
overflow: 'hidden',
|
|
7311
|
+
textOverflow: 'ellipsis',
|
|
7312
|
+
whiteSpace: 'nowrap'
|
|
7313
|
+
},
|
|
7314
|
+
children: title
|
|
7245
7315
|
})
|
|
7246
|
-
})
|
|
7247
|
-
})
|
|
7248
|
-
|
|
7316
|
+
})
|
|
7317
|
+
}), jsx(WorkspaceMenu, {
|
|
7318
|
+
isOpen: showMenu,
|
|
7319
|
+
closeMenu: function closeMenu() {
|
|
7320
|
+
return onToggleDialog == null ? void 0 : onToggleDialog(false);
|
|
7321
|
+
}
|
|
7322
|
+
})]
|
|
7323
|
+
});
|
|
7249
7324
|
};
|
|
7250
|
-
var WorkspaceViewTitleConnect = /*#__PURE__*/React.memo(WorkspaceViewTitleConnectNoMemo);
|
|
7251
7325
|
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
return getUniqueId(existingIds, count + 1);
|
|
7276
|
-
}
|
|
7277
|
-
return newId;
|
|
7278
|
-
};
|
|
7279
|
-
var createBalancedMosaicNode = function createBalancedMosaicNode(currentNode) {
|
|
7280
|
-
var leaves = getLeaves(currentNode);
|
|
7281
|
-
return createBalancedTreeFromLeaves(leaves);
|
|
7282
|
-
};
|
|
7283
|
-
var closeDialogsWhenChangingPreset = function closeDialogsWhenChangingPreset(componentTypes, dispatch) {
|
|
7284
|
-
if (!componentTypes || componentTypes.length === 0 || componentTypes.some(function (componentType) {
|
|
7285
|
-
return componentType.toLowerCase().includes('viewloading');
|
|
7286
|
-
})) {
|
|
7287
|
-
return;
|
|
7288
|
-
}
|
|
7289
|
-
// Close all dialogs related to timeseries
|
|
7290
|
-
if (!componentTypes.some(function (componentType) {
|
|
7291
|
-
return componentType.toLowerCase().includes('timeseries');
|
|
7292
|
-
})) {
|
|
7293
|
-
dispatch(uiActions.setToggleOpenDialog({
|
|
7294
|
-
setOpen: false,
|
|
7295
|
-
type: uiTypes.DialogTypes.TimeSeriesManager
|
|
7296
|
-
}));
|
|
7297
|
-
dispatch(uiActions.setToggleOpenDialog({
|
|
7298
|
-
setOpen: false,
|
|
7299
|
-
type: uiTypes.DialogTypes.TimeSeriesSelect
|
|
7300
|
-
}));
|
|
7301
|
-
dispatch(uiActions.setToggleOpenDialog({
|
|
7302
|
-
setOpen: false,
|
|
7303
|
-
type: uiTypes.DialogTypes.TimeSeriesInfo
|
|
7304
|
-
}));
|
|
7305
|
-
dispatch(uiActions.setToggleOpenDialog({
|
|
7306
|
-
setOpen: false,
|
|
7307
|
-
type: uiTypes.DialogTypes.TimeSeriesLocationInfo
|
|
7308
|
-
}));
|
|
7309
|
-
}
|
|
7310
|
-
// Close all dialogs related to soundings
|
|
7311
|
-
if (!componentTypes.some(function (componentType) {
|
|
7312
|
-
return componentType.toLowerCase().includes('soundings');
|
|
7313
|
-
})) {
|
|
7314
|
-
dispatch(uiActions.setToggleOpenDialog({
|
|
7315
|
-
setOpen: false,
|
|
7316
|
-
type: uiTypes.DialogTypes.SoundingsLocations
|
|
7317
|
-
}));
|
|
7318
|
-
dispatch(uiActions.setToggleOpenDialog({
|
|
7319
|
-
setOpen: false,
|
|
7320
|
-
type: uiTypes.DialogTypes.SoundingsSources
|
|
7321
|
-
}));
|
|
7322
|
-
}
|
|
7323
|
-
// Close dialogs related to the warninglist
|
|
7324
|
-
if (!componentTypes.some(function (componentType) {
|
|
7325
|
-
return componentType.toLowerCase().includes('warninglist');
|
|
7326
|
-
}) && !componentTypes.some(function (componentType) {
|
|
7327
|
-
return componentType.toLowerCase().includes('map');
|
|
7328
|
-
})) {
|
|
7329
|
-
dispatch(uiActions.setToggleOpenDialog({
|
|
7330
|
-
setOpen: false,
|
|
7331
|
-
type: uiTypes.DialogTypes.PublicWarnings
|
|
7332
|
-
}));
|
|
7333
|
-
}
|
|
7326
|
+
var LoadingIndicatorConnect = function LoadingIndicatorConnect(_ref) {
|
|
7327
|
+
var panelId = _ref.panelId;
|
|
7328
|
+
var isLoading = useSelector(function (store) {
|
|
7329
|
+
return loadingIndicatorSelectors.isLoading(store, panelId);
|
|
7330
|
+
});
|
|
7331
|
+
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7332
|
+
t = _useWorkspaceTranslat.t;
|
|
7333
|
+
return jsx(CustomTooltip, {
|
|
7334
|
+
title: isLoading ? t('workspace-loading-indicator-loading') : t('workspace-loading-indicator-idle'),
|
|
7335
|
+
children: jsx("span", {
|
|
7336
|
+
style: {
|
|
7337
|
+
height: '100%'
|
|
7338
|
+
},
|
|
7339
|
+
children: isLoading ? jsx(CloudLoading, {
|
|
7340
|
+
"data-testid": "cloudicon-loading",
|
|
7341
|
+
style: {
|
|
7342
|
+
fill: '#186DFF'
|
|
7343
|
+
}
|
|
7344
|
+
}) : jsx(CloudIdle, {
|
|
7345
|
+
"data-testid": "cloudicon-idle"
|
|
7346
|
+
})
|
|
7347
|
+
})
|
|
7348
|
+
});
|
|
7334
7349
|
};
|
|
7335
7350
|
|
|
7336
|
-
var
|
|
7337
|
-
|
|
7338
|
-
var
|
|
7351
|
+
var workspaceOptionsButtonId = 'workspace-options-toolbutton';
|
|
7352
|
+
var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
7353
|
+
var _ref$id = _ref.id,
|
|
7354
|
+
id = _ref$id === void 0 ? workspaceOptionsButtonId : _ref$id,
|
|
7355
|
+
handleSave = _ref.handleSave,
|
|
7356
|
+
handleSaveAs = _ref.handleSaveAs,
|
|
7357
|
+
handleEdit = _ref.handleEdit,
|
|
7358
|
+
handleDelete = _ref.handleDelete,
|
|
7359
|
+
handleReset = _ref.handleReset,
|
|
7360
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
7361
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
7362
|
+
_ref$isDefaultOpen = _ref.isDefaultOpen,
|
|
7363
|
+
isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen;
|
|
7339
7364
|
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7340
7365
|
t = _useWorkspaceTranslat.t;
|
|
7366
|
+
var theme = useTheme();
|
|
7341
7367
|
var _React$useState = React__default.useState(null),
|
|
7342
7368
|
anchorEl = _React$useState[0],
|
|
7343
7369
|
setAnchorEl = _React$useState[1];
|
|
7344
|
-
var
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
var viewsById = useSelector(getViewsById);
|
|
7348
|
-
var selectedMapIds = useSelector(function (store) {
|
|
7349
|
-
return genericSelectors.getLinkedMaps(store, panelId);
|
|
7350
|
-
});
|
|
7351
|
-
var viewComponentType = useSelector(function (store) {
|
|
7352
|
-
return getViewComponentType(store, panelId);
|
|
7353
|
-
});
|
|
7354
|
-
var sharedFeature = useSelector(function (store) {
|
|
7355
|
-
return genericSelectors.getSelectedFeature(store.syncGroups, panelId);
|
|
7356
|
-
});
|
|
7357
|
-
var mapPinLocation = useSelector(function (store) {
|
|
7358
|
-
return mapSelectors.getPinLocation(store, selectedMapIds[0] || '');
|
|
7359
|
-
});
|
|
7360
|
-
var handleLinkViews = function handleLinkViews(event) {
|
|
7361
|
-
setAnchorEl(event.currentTarget);
|
|
7362
|
-
};
|
|
7363
|
-
var handleMenuClose = function handleMenuClose() {
|
|
7364
|
-
setAnchorEl(null);
|
|
7365
|
-
};
|
|
7366
|
-
var handleMapSelect = function handleMapSelect(mapId) {
|
|
7367
|
-
var updatedMapIds = selectedMapIds.includes(mapId) ? selectedMapIds.filter(function (id) {
|
|
7368
|
-
return id !== mapId;
|
|
7369
|
-
}) : [].concat(selectedMapIds, [mapId]);
|
|
7370
|
-
dispatch(genericActions.updateLinkedMap({
|
|
7371
|
-
panelId: panelId,
|
|
7372
|
-
mapIds: updatedMapIds
|
|
7373
|
-
}));
|
|
7374
|
-
// Sync pin to newly added map for TimeSeries components
|
|
7375
|
-
if (!selectedMapIds.includes(mapId) && viewComponentType === 'TimeSeries') {
|
|
7376
|
-
// Observation station
|
|
7377
|
-
if (sharedFeature) {
|
|
7378
|
-
dispatch(mapActions.setMapPinLocation({
|
|
7379
|
-
mapId: mapId,
|
|
7380
|
-
mapPinLocation: {
|
|
7381
|
-
lon: sharedFeature.lon,
|
|
7382
|
-
lat: sharedFeature.lat
|
|
7383
|
-
}
|
|
7384
|
-
}));
|
|
7385
|
-
// Grid
|
|
7386
|
-
} else if (mapPinLocation) {
|
|
7387
|
-
dispatch(mapActions.setMapPinLocation({
|
|
7388
|
-
mapId: mapId,
|
|
7389
|
-
mapPinLocation: mapPinLocation
|
|
7390
|
-
}));
|
|
7391
|
-
}
|
|
7392
|
-
}
|
|
7370
|
+
var isOpen = Boolean(anchorEl) || isDefaultOpen;
|
|
7371
|
+
var handleClick = function handleClick(event) {
|
|
7372
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
7393
7373
|
};
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7374
|
+
var options = [{
|
|
7375
|
+
title: t('workspace-save'),
|
|
7376
|
+
callback: handleSave
|
|
7377
|
+
}, {
|
|
7378
|
+
title: t('workspace-save-as'),
|
|
7379
|
+
callback: handleSaveAs
|
|
7380
|
+
}, {
|
|
7381
|
+
title: t('workspace-edit'),
|
|
7382
|
+
callback: handleEdit
|
|
7383
|
+
}, {
|
|
7384
|
+
title: t('workspace-reset'),
|
|
7385
|
+
callback: handleReset
|
|
7386
|
+
}, {
|
|
7387
|
+
title: t('workspace-delete'),
|
|
7388
|
+
callback: handleDelete
|
|
7389
|
+
}];
|
|
7390
|
+
var renderButton = function renderButton() {
|
|
7391
|
+
return jsxs(CustomIconButton, {
|
|
7392
|
+
onClick: handleClick,
|
|
7393
|
+
"data-testid": id,
|
|
7394
|
+
isSelected: isOpen,
|
|
7395
|
+
"aria-label": "workspace options",
|
|
7396
|
+
variant: "tool",
|
|
7397
|
+
disabled: isDisabled,
|
|
7399
7398
|
sx: {
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
}
|
|
7409
|
-
}) : jsx(LinkOff, {
|
|
7410
|
-
"data-testid": "link-off-icon",
|
|
7411
|
-
style: {
|
|
7412
|
-
fill: anchorEl ? 'white' : undefined,
|
|
7413
|
-
backgroundColor: anchorEl ? '#186DFF' : undefined
|
|
7399
|
+
'&&': {
|
|
7400
|
+
backgroundColor: !isOpen ? 'transparent' : 'geowebColors.workspace.tabButtonHover',
|
|
7401
|
+
'&:hover': {
|
|
7402
|
+
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
7403
|
+
},
|
|
7404
|
+
'.MuiSvgIcon-root > path': {
|
|
7405
|
+
fill: isOpen ? theme.palette.geowebColors.iconButtons.tool.active.color : undefined
|
|
7406
|
+
}
|
|
7414
7407
|
}
|
|
7415
|
-
}
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
fontWeight: 'bold'
|
|
7408
|
+
},
|
|
7409
|
+
children: [jsx(Options, {}), jsxs(Menu, {
|
|
7410
|
+
BackdropProps: {
|
|
7411
|
+
style: {
|
|
7412
|
+
opacity: 0,
|
|
7413
|
+
transition: 'none'
|
|
7414
|
+
}
|
|
7415
|
+
},
|
|
7416
|
+
open: isOpen && !isDisabled,
|
|
7417
|
+
anchorEl: anchorEl,
|
|
7418
|
+
onClose: function onClose() {
|
|
7419
|
+
return setAnchorEl(null);
|
|
7428
7420
|
},
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7421
|
+
anchorOrigin: {
|
|
7422
|
+
vertical: 21,
|
|
7423
|
+
horizontal: 6
|
|
7424
|
+
},
|
|
7425
|
+
sx: {
|
|
7426
|
+
'& .MuiMenu-list': {
|
|
7427
|
+
padding: 0
|
|
7428
|
+
},
|
|
7429
|
+
'& .MuiMenuItem-root': {
|
|
7430
|
+
fontSize: 16
|
|
7431
|
+
}
|
|
7432
|
+
},
|
|
7433
|
+
children: [jsx(ListSubheader, {
|
|
7434
|
+
sx: {
|
|
7435
|
+
paddingTop: '8px'
|
|
7436
|
+
},
|
|
7437
|
+
children: jsx(Typography, {
|
|
7438
|
+
sx: {
|
|
7439
|
+
letterSpacing: '0.4px',
|
|
7440
|
+
fontSize: 12
|
|
7438
7441
|
},
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
children: jsx(Checkbox, {
|
|
7451
|
-
edge: "start",
|
|
7452
|
-
tabIndex: -1,
|
|
7453
|
-
checked: selectedMapIds.includes(mapId),
|
|
7454
|
-
disableRipple: true,
|
|
7455
|
-
inputProps: {
|
|
7456
|
-
'aria-labelledby': labelId
|
|
7457
|
-
}
|
|
7458
|
-
})
|
|
7459
|
-
}), jsx(ListItemText, {
|
|
7460
|
-
id: labelId,
|
|
7461
|
-
primary: (_viewsById$mapId = viewsById[mapId]) == null ? void 0 : _viewsById$mapId.title,
|
|
7462
|
-
secondary: mapId
|
|
7463
|
-
})]
|
|
7464
|
-
})
|
|
7465
|
-
}, mapId);
|
|
7466
|
-
})
|
|
7442
|
+
children: t('workspace-options')
|
|
7443
|
+
})
|
|
7444
|
+
}), options.map(function (_ref2) {
|
|
7445
|
+
var title = _ref2.title,
|
|
7446
|
+
callback = _ref2.callback;
|
|
7447
|
+
return jsx(MenuItem, {
|
|
7448
|
+
onClick: callback,
|
|
7449
|
+
disabled: !callback,
|
|
7450
|
+
children: title
|
|
7451
|
+
}, title);
|
|
7452
|
+
})]
|
|
7467
7453
|
})]
|
|
7468
|
-
})
|
|
7454
|
+
});
|
|
7455
|
+
};
|
|
7456
|
+
return isDisabled ? renderButton() : jsx(CustomTooltip, {
|
|
7457
|
+
title: !isOpen && t('workspace-options'),
|
|
7458
|
+
TransitionProps: {
|
|
7459
|
+
exit: false
|
|
7460
|
+
},
|
|
7461
|
+
children: renderButton()
|
|
7469
7462
|
});
|
|
7470
7463
|
};
|
|
7471
7464
|
|
|
7472
|
-
var
|
|
7473
|
-
|
|
7474
|
-
marginRight: 0.5
|
|
7475
|
-
};
|
|
7476
|
-
var WorkspaceControls = function WorkspaceControls(_ref) {
|
|
7465
|
+
var _excluded$4 = ["title", "scope"];
|
|
7466
|
+
var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_ref) {
|
|
7477
7467
|
var panelId = _ref.panelId,
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
shouldPreventCloseView = _ref$shouldPreventClo === void 0 ? false : _ref$shouldPreventClo,
|
|
7482
|
-
removeLinkedMap = _ref.removeLinkedMap;
|
|
7483
|
-
var confirmDialog = useConfirmationDialog();
|
|
7484
|
-
var _React$useContext = React.useContext(MosaicContext),
|
|
7485
|
-
actions = _React$useContext.mosaicActions;
|
|
7468
|
+
isViewPresetDialogOpen = _ref.isViewPresetDialogOpen;
|
|
7469
|
+
var dispatch = useDispatch();
|
|
7470
|
+
var store = useStore();
|
|
7486
7471
|
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7487
7472
|
t = _useWorkspaceTranslat.t;
|
|
7488
|
-
var
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
if (!isEqual(mosaicNode, stateAfterExpand)) {
|
|
7507
|
-
setEnableUnexpand(false);
|
|
7508
|
-
setStateAfterExpand(undefined);
|
|
7509
|
-
}
|
|
7510
|
-
}
|
|
7511
|
-
}, [enableUnexpand, mosaicNode, stateAfterExpand]);
|
|
7512
|
-
var onClose = /*#__PURE__*/function () {
|
|
7513
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7514
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7515
|
-
while (1) switch (_context.prev = _context.next) {
|
|
7516
|
-
case 0:
|
|
7517
|
-
if (!shouldPreventCloseView) {
|
|
7518
|
-
_context.next = 7;
|
|
7519
|
-
break;
|
|
7520
|
-
}
|
|
7521
|
-
_context.next = 3;
|
|
7522
|
-
return confirmDialog({
|
|
7523
|
-
title: t('workspace-control-close-message-title'),
|
|
7524
|
-
description: t('workspace-control-close-message-description'),
|
|
7525
|
-
confirmLabel: t('workspace-control-close')
|
|
7526
|
-
});
|
|
7527
|
-
case 3:
|
|
7528
|
-
actions.remove(path);
|
|
7529
|
-
removeLinkedMap(panelId);
|
|
7530
|
-
_context.next = 9;
|
|
7531
|
-
break;
|
|
7532
|
-
case 7:
|
|
7533
|
-
actions.remove(path);
|
|
7534
|
-
removeLinkedMap(panelId);
|
|
7535
|
-
case 9:
|
|
7536
|
-
case "end":
|
|
7537
|
-
return _context.stop();
|
|
7538
|
-
}
|
|
7539
|
-
}, _callee);
|
|
7540
|
-
}));
|
|
7541
|
-
return function onClose() {
|
|
7542
|
-
return _ref2.apply(this, arguments);
|
|
7543
|
-
};
|
|
7544
|
-
}();
|
|
7545
|
-
return jsxs(Fragment, {
|
|
7546
|
-
children: [jsx(LinkMenuConnect, {
|
|
7547
|
-
panelId: panelId
|
|
7548
|
-
}), jsx(CustomIconButton, {
|
|
7549
|
-
"data-testid": "split-horizontal-btn",
|
|
7550
|
-
sx: buttonStyle,
|
|
7551
|
-
onClick: function onClick() {
|
|
7552
|
-
var newNode = createNode();
|
|
7553
|
-
var previousNode = getAndAssertNodeAtPathExists(actions.getRoot(), path);
|
|
7554
|
-
actions.replaceWith(path, {
|
|
7555
|
-
direction: 'column',
|
|
7556
|
-
first: previousNode,
|
|
7557
|
-
second: newNode
|
|
7558
|
-
});
|
|
7559
|
-
},
|
|
7560
|
-
tooltipTitle: t('workspace-control-split-horizontal'),
|
|
7561
|
-
children: jsx(SplitVertical, {})
|
|
7562
|
-
}), jsx(CustomIconButton, {
|
|
7563
|
-
"data-testid": "split-vertical-btn",
|
|
7564
|
-
sx: buttonStyle,
|
|
7565
|
-
onClick: function onClick() {
|
|
7566
|
-
var newNode = createNode();
|
|
7567
|
-
var previousNode = getAndAssertNodeAtPathExists(actions.getRoot(), path);
|
|
7568
|
-
actions.replaceWith(path, {
|
|
7569
|
-
direction: 'row',
|
|
7570
|
-
first: previousNode,
|
|
7571
|
-
second: newNode
|
|
7572
|
-
});
|
|
7573
|
-
},
|
|
7574
|
-
tooltipTitle: t('workspace-control-split-vertical'),
|
|
7575
|
-
children: jsx(SplitHorizontal, {})
|
|
7576
|
-
}), !enableUnexpand || isString(mosaicNode) ? jsx(CustomIconButton, {
|
|
7577
|
-
"data-testid": "expand-btn",
|
|
7578
|
-
sx: buttonStyle,
|
|
7579
|
-
onClick: function onClick() {
|
|
7580
|
-
setStateBeforeExpand(mosaicNode);
|
|
7581
|
-
setEnableUnexpand(true);
|
|
7582
|
-
actions.expand(path, 70);
|
|
7583
|
-
},
|
|
7584
|
-
tooltipTitle: t('workspace-control-expand'),
|
|
7585
|
-
children: jsx(Expand, {})
|
|
7586
|
-
}) : jsx(CustomIconButton, {
|
|
7587
|
-
"data-testid": "unexpand-btn",
|
|
7588
|
-
sx: buttonStyle,
|
|
7589
|
-
onClick: function onClick() {
|
|
7590
|
-
var stateBeforeExpandCopy = isString(stateBeforeExpand) ? stateBeforeExpand : Object.assign({}, stateBeforeExpand);
|
|
7591
|
-
actions.replaceWith([], stateBeforeExpandCopy);
|
|
7592
|
-
},
|
|
7593
|
-
tooltipTitle: t('workspace-control-unexpand'),
|
|
7594
|
-
children: jsx(UnExpand, {})
|
|
7595
|
-
}), jsx(CustomIconButton, {
|
|
7596
|
-
"data-testid": "close-btn",
|
|
7597
|
-
sx: buttonStyle,
|
|
7598
|
-
onClick: onClose,
|
|
7599
|
-
tooltipTitle: t('workspace-control-close'),
|
|
7600
|
-
id: "close-window-button",
|
|
7601
|
-
children: jsx(Close, {})
|
|
7602
|
-
})]
|
|
7603
|
-
});
|
|
7604
|
-
};
|
|
7605
|
-
|
|
7606
|
-
var WorkspaceTileConnect = /*#__PURE__*/React.memo(function (_ref) {
|
|
7607
|
-
var _ref$mosaicNodeId = _ref.mosaicNodeId,
|
|
7608
|
-
mosaicNodeId = _ref$mosaicNodeId === void 0 ? '' : _ref$mosaicNodeId,
|
|
7609
|
-
path = _ref.path,
|
|
7610
|
-
componentsLookUp = _ref.componentsLookUp;
|
|
7611
|
-
var dispatch = useDispatch();
|
|
7612
|
-
useFetchViewPresets(mosaicNodeId);
|
|
7613
|
-
var view = useSelector(function (store) {
|
|
7614
|
-
return getViewById(store, mosaicNodeId);
|
|
7615
|
-
});
|
|
7616
|
-
var viewIds = useSelector(function (store) {
|
|
7617
|
-
return getViewIds(store);
|
|
7473
|
+
var _useAuthenticationCon = useAuthenticationContext(),
|
|
7474
|
+
currentRole = _useAuthenticationCon.currentRole,
|
|
7475
|
+
isLoggedIn = _useAuthenticationCon.isLoggedIn,
|
|
7476
|
+
auth = _useAuthenticationCon.auth;
|
|
7477
|
+
var isAdmin = (currentRole == null ? void 0 : currentRole.name) === GEOWEB_ROLE_PRESETS_ADMIN.name;
|
|
7478
|
+
var workspaceView = useSelector(function (store) {
|
|
7479
|
+
var _workspaceSelectors$g;
|
|
7480
|
+
var _ref2 = (_workspaceSelectors$g = getViewById(store, panelId)) != null ? _workspaceSelectors$g : {},
|
|
7481
|
+
title = _ref2.title,
|
|
7482
|
+
scope = _ref2.scope,
|
|
7483
|
+
restProps = _objectWithoutPropertiesLoose(_ref2, _excluded$4);
|
|
7484
|
+
return Object.assign({
|
|
7485
|
+
title: title,
|
|
7486
|
+
scope: scope
|
|
7487
|
+
}, restProps);
|
|
7488
|
+
}, shallowEqual);
|
|
7489
|
+
var viewComponentType = useSelector(function (store) {
|
|
7490
|
+
return getViewComponentType(store, panelId);
|
|
7618
7491
|
});
|
|
7619
|
-
var
|
|
7620
|
-
return
|
|
7492
|
+
var hasViewPresetChanges = useSelector(function (store) {
|
|
7493
|
+
return getViewPresetHasChanges(store, panelId);
|
|
7621
7494
|
});
|
|
7622
|
-
var
|
|
7623
|
-
return
|
|
7495
|
+
var activeViewPresetId = useSelector(function (store) {
|
|
7496
|
+
return getViewPresetActiveId(store, panelId);
|
|
7624
7497
|
});
|
|
7625
|
-
var
|
|
7626
|
-
return
|
|
7498
|
+
var relatedSyncGroupIds = useSelector(function (store) {
|
|
7499
|
+
return syncGroupsSelectors.getAllTargetGroupsForSource(store, panelId);
|
|
7627
7500
|
});
|
|
7628
|
-
var
|
|
7629
|
-
return
|
|
7501
|
+
var currentViewPreset = useSelector(function (store) {
|
|
7502
|
+
return workspaceView.id ? getViewPresetFromList(store, workspaceView.id) : undefined;
|
|
7630
7503
|
});
|
|
7631
|
-
var
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
var
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
dispatch(viewPresetActions.
|
|
7638
|
-
|
|
7639
|
-
viewPresetId: mapPresetId
|
|
7504
|
+
var presetAbstract = workspaceView == null ? void 0 : workspaceView["abstract"];
|
|
7505
|
+
var isNewActive = activeViewPresetId === '';
|
|
7506
|
+
var title = workspaceView.title || t('workspace-mappreset-new');
|
|
7507
|
+
var viewScope = workspaceView.scope;
|
|
7508
|
+
var fullTitle = getPresetTitle(title, hasViewPresetChanges, isNewActive, t);
|
|
7509
|
+
var openViewPresetsDialog = React.useCallback(function (viewPresetDialogOptions) {
|
|
7510
|
+
dispatch(viewPresetActions.openViewPresetDialog({
|
|
7511
|
+
viewPresetDialog: viewPresetDialogOptions
|
|
7640
7512
|
}));
|
|
7641
7513
|
}, [dispatch]);
|
|
7642
|
-
var
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7514
|
+
var currentWarningsPreset = useSelector(function (store) {
|
|
7515
|
+
return publicWarningsSelectors.getWarningsPresetById(store, panelId);
|
|
7516
|
+
});
|
|
7517
|
+
var constructInitialProps = React.useCallback(function () {
|
|
7518
|
+
switch (viewComponentType) {
|
|
7519
|
+
case 'WarningList':
|
|
7520
|
+
return currentWarningsPreset;
|
|
7521
|
+
case 'TimeSeries':
|
|
7522
|
+
return timeSeriesSelectors.getTimeSeriesPreset(store.getState());
|
|
7523
|
+
case 'Map':
|
|
7524
|
+
return {
|
|
7525
|
+
mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
|
|
7526
|
+
syncGroupsIds: relatedSyncGroupIds
|
|
7527
|
+
};
|
|
7528
|
+
default:
|
|
7529
|
+
return undefined;
|
|
7530
|
+
}
|
|
7531
|
+
}, [currentWarningsPreset, panelId, relatedSyncGroupIds, store, viewComponentType]);
|
|
7532
|
+
var onSave = React.useCallback(function () {
|
|
7533
|
+
dispatch(viewPresetActions.saveViewPreset({
|
|
7534
|
+
panelId: panelId,
|
|
7535
|
+
viewPresetId: activeViewPresetId,
|
|
7536
|
+
viewPreset: Object.assign({}, emptyViewPreset(viewComponentType), {
|
|
7537
|
+
title: title,
|
|
7538
|
+
initialProps: constructInitialProps()
|
|
7539
|
+
})
|
|
7646
7540
|
}));
|
|
7647
|
-
}, [dispatch]);
|
|
7648
|
-
var
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7541
|
+
}, [activeViewPresetId, constructInitialProps, dispatch, panelId, title, viewComponentType]);
|
|
7542
|
+
var onDelete = React.useCallback(function () {
|
|
7543
|
+
openViewPresetsDialog({
|
|
7544
|
+
title: t('workspace-mappreset-dialog-title-delete'),
|
|
7545
|
+
action: PresetAction.DELETE,
|
|
7546
|
+
viewPresetId: activeViewPresetId,
|
|
7547
|
+
panelId: panelId,
|
|
7548
|
+
formValues: {
|
|
7549
|
+
title: title,
|
|
7550
|
+
"abstract": presetAbstract
|
|
7551
|
+
}
|
|
7552
|
+
});
|
|
7553
|
+
}, [activeViewPresetId, openViewPresetsDialog, panelId, title, presetAbstract, t]);
|
|
7554
|
+
var onSaveAs = React.useCallback(function () {
|
|
7555
|
+
var formTitle = activeViewPresetId ? title : '';
|
|
7556
|
+
openViewPresetsDialog({
|
|
7557
|
+
title: t('workspace-mappreset-save-as'),
|
|
7558
|
+
action: PresetAction.SAVE_AS,
|
|
7559
|
+
viewPresetId: activeViewPresetId,
|
|
7560
|
+
panelId: panelId,
|
|
7561
|
+
formValues: {
|
|
7562
|
+
title: formTitle,
|
|
7563
|
+
initialProps: constructInitialProps(),
|
|
7564
|
+
"abstract": presetAbstract
|
|
7565
|
+
}
|
|
7566
|
+
});
|
|
7567
|
+
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title, presetAbstract]);
|
|
7568
|
+
var onEdit = React.useCallback(function () {
|
|
7569
|
+
var formTitle = activeViewPresetId ? title : '';
|
|
7570
|
+
openViewPresetsDialog({
|
|
7571
|
+
title: t('workspace-mappreset-dialog-title-edit'),
|
|
7572
|
+
action: PresetAction.EDIT,
|
|
7573
|
+
panelId: panelId,
|
|
7574
|
+
viewPresetId: activeViewPresetId,
|
|
7575
|
+
formValues: {
|
|
7576
|
+
title: formTitle,
|
|
7577
|
+
initialProps: constructInitialProps(),
|
|
7578
|
+
"abstract": presetAbstract
|
|
7579
|
+
}
|
|
7580
|
+
});
|
|
7581
|
+
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title, presetAbstract]);
|
|
7582
|
+
var onReset = React.useCallback(function () {
|
|
7583
|
+
openViewPresetsDialog({
|
|
7584
|
+
title: t('workspace-reset-title'),
|
|
7585
|
+
action: PresetAction.RESET,
|
|
7586
|
+
viewPresetId: activeViewPresetId,
|
|
7587
|
+
panelId: panelId,
|
|
7588
|
+
formValues: {
|
|
7589
|
+
title: title
|
|
7590
|
+
}
|
|
7591
|
+
});
|
|
7592
|
+
}, [activeViewPresetId, openViewPresetsDialog, panelId, t, title]);
|
|
7593
|
+
var toggleViewPresetDialog = React.useCallback(function (_ref3) {
|
|
7594
|
+
var panelId = _ref3.panelId,
|
|
7595
|
+
isViewPresetDialogOpen = _ref3.isViewPresetDialogOpen;
|
|
7654
7596
|
dispatch(viewPresetActions.toggleViewPresetListDialog({
|
|
7655
7597
|
panelId: panelId,
|
|
7656
7598
|
isViewPresetListDialogOpen: isViewPresetDialogOpen
|
|
7657
7599
|
}));
|
|
7658
7600
|
}, [dispatch]);
|
|
7659
|
-
var
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
mosaicNodeId: mosaicNodeId,
|
|
7664
|
-
newId: newId
|
|
7665
|
-
});
|
|
7666
|
-
return newId;
|
|
7667
|
-
}, [addView, mosaicNodeId, viewIds]);
|
|
7668
|
-
var title = (view == null ? void 0 : view.title) || (view == null ? void 0 : view.id) || mosaicNodeId;
|
|
7669
|
-
React.useEffect(function () {
|
|
7670
|
-
var viewPresetId = (view == null ? void 0 : view.id) || '';
|
|
7671
|
-
registerView({
|
|
7672
|
-
panelId: mosaicNodeId,
|
|
7673
|
-
mapPresetId: viewPresetId
|
|
7674
|
-
});
|
|
7675
|
-
return function () {
|
|
7676
|
-
unregisterView({
|
|
7677
|
-
panelId: mosaicNodeId
|
|
7678
|
-
});
|
|
7679
|
-
};
|
|
7680
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7681
|
-
}, [registerView, unregisterView]);
|
|
7682
|
-
// generic componentsLookUp
|
|
7683
|
-
var genericComponentsLookupResult = React.useMemo(function () {
|
|
7684
|
-
return componentsLookUp({
|
|
7685
|
-
title: title,
|
|
7686
|
-
id: mosaicNodeId,
|
|
7687
|
-
componentType: view == null ? void 0 : view.componentType,
|
|
7688
|
-
initialProps: view == null ? void 0 : view.initialProps
|
|
7689
|
-
});
|
|
7690
|
-
}, [componentsLookUp, mosaicNodeId, title, view == null ? void 0 : view.componentType, view == null ? void 0 : view.initialProps]);
|
|
7691
|
-
// default componentsLookUp
|
|
7692
|
-
var defaultComponentsLookupResult = React.useMemo(function () {
|
|
7693
|
-
return defaultComponentsLookUp({
|
|
7694
|
-
viewPresetId: view == null ? void 0 : view.id,
|
|
7695
|
-
componentType: view == null ? void 0 : view.componentType,
|
|
7696
|
-
mosaicNodeId: mosaicNodeId
|
|
7601
|
+
var onClickOpenViewPreset = React.useCallback(function () {
|
|
7602
|
+
toggleViewPresetDialog({
|
|
7603
|
+
panelId: panelId,
|
|
7604
|
+
isViewPresetDialogOpen: !isViewPresetDialogOpen
|
|
7697
7605
|
});
|
|
7698
|
-
}, [
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
path: path,
|
|
7710
|
-
shouldPreventCloseView: shouldPreventCloseView,
|
|
7711
|
-
removeLinkedMap: removeLinkedMap
|
|
7712
|
-
}),
|
|
7713
|
-
children: [isViewPresetsFetching && jsx(LinearProgress, {
|
|
7714
|
-
"data-testid": "loading-bar",
|
|
7715
|
-
color: "secondary",
|
|
7716
|
-
sx: {
|
|
7717
|
-
position: 'absolute',
|
|
7718
|
-
width: '100%',
|
|
7719
|
-
top: 0,
|
|
7720
|
-
zIndex: 1001
|
|
7721
|
-
}
|
|
7722
|
-
}), errorViewPreset && jsx(Box, {
|
|
7606
|
+
}, [isViewPresetDialogOpen, panelId, toggleViewPresetDialog]);
|
|
7607
|
+
renderCounter.count(WorkspaceViewTitleConnectNoMemo.name);
|
|
7608
|
+
var viewpresetCreator = (currentViewPreset == null ? void 0 : currentViewPreset.username) || '';
|
|
7609
|
+
var isUserPresetCreator = (auth == null ? void 0 : auth.username) === viewpresetCreator;
|
|
7610
|
+
var currentViewScope = viewScope || 'system';
|
|
7611
|
+
var isEnabled = (currentViewScope === 'user' && isUserPresetCreator || isAdmin && currentViewScope === 'system') && activeViewPresetId !== '' && isLoggedIn;
|
|
7612
|
+
return (
|
|
7613
|
+
// Zero-length string assignment prevents showing title as an empty object '[object Object]'.
|
|
7614
|
+
// in child components. This is a workaround for a limitation in the Tooltip component.
|
|
7615
|
+
jsxs(Grid, {
|
|
7616
|
+
title: "",
|
|
7723
7617
|
sx: {
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
children: jsx(AlertBanner, {
|
|
7730
|
-
title: errorViewPreset,
|
|
7731
|
-
shouldClose: true
|
|
7732
|
-
})
|
|
7733
|
-
}), defaultComponentsLookupResult, genericComponentsLookupResult, jsx(ViewPresetMenu, {
|
|
7734
|
-
panelId: mosaicNodeId,
|
|
7735
|
-
closeMenu: function closeMenu() {
|
|
7736
|
-
toggleViewPresetDialog({
|
|
7737
|
-
panelId: mosaicNodeId,
|
|
7738
|
-
isViewPresetDialogOpen: false
|
|
7739
|
-
});
|
|
7618
|
+
display: 'flex',
|
|
7619
|
+
flexGrow: 3,
|
|
7620
|
+
flexDirection: 'row',
|
|
7621
|
+
alignItems: 'center',
|
|
7622
|
+
justifyContent: 'space-between'
|
|
7740
7623
|
},
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7624
|
+
children: [jsxs(Box, {
|
|
7625
|
+
sx: {
|
|
7626
|
+
display: 'flex',
|
|
7627
|
+
alignItems: 'center',
|
|
7628
|
+
flexGrow: 1,
|
|
7629
|
+
minWidth: 0,
|
|
7630
|
+
gap: 1
|
|
7631
|
+
},
|
|
7632
|
+
children: [jsx(CustomTooltip, {
|
|
7633
|
+
title: !isViewPresetDialogOpen && jsxs(Fragment, {
|
|
7634
|
+
children: [jsx(Box, {
|
|
7635
|
+
component: "span",
|
|
7636
|
+
sx: {
|
|
7637
|
+
fontWeight: 'bold',
|
|
7638
|
+
display: 'block'
|
|
7639
|
+
},
|
|
7640
|
+
children: t('workspace-viewpreset-menu')
|
|
7641
|
+
}), jsx(Box, {
|
|
7642
|
+
component: "span",
|
|
7643
|
+
children: t('workspace-currently') + ": " + title
|
|
7644
|
+
})]
|
|
7645
|
+
}),
|
|
7646
|
+
TransitionProps: {
|
|
7647
|
+
exit: false
|
|
7648
|
+
},
|
|
7649
|
+
children: jsxs(CustomToggleButton, {
|
|
7650
|
+
variant: "tool",
|
|
7651
|
+
"data-testid": "open-viewpresets",
|
|
7652
|
+
selected: isViewPresetDialogOpen,
|
|
7653
|
+
onClick: onClickOpenViewPreset,
|
|
7654
|
+
disableRipple: true,
|
|
7655
|
+
sx: {
|
|
7656
|
+
flexShrink: 1,
|
|
7657
|
+
minWidth: 0,
|
|
7658
|
+
maxWidth: 220,
|
|
7659
|
+
justifyContent: 'flex-start',
|
|
7660
|
+
alignItems: 'center',
|
|
7661
|
+
textAlign: 'left',
|
|
7662
|
+
fontSize: '12px',
|
|
7663
|
+
fontWeight: 500,
|
|
7664
|
+
fontStyle: hasViewPresetChanges || isNewActive ? 'italic' : undefined,
|
|
7665
|
+
height: 20,
|
|
7666
|
+
overflow: 'hidden',
|
|
7667
|
+
'&&': {
|
|
7668
|
+
textTransform: 'none',
|
|
7669
|
+
backgroundColor: !isViewPresetDialogOpen ? 'transparent' : 'geowebColors.workspace.tabButtonHover',
|
|
7670
|
+
'&:hover': {
|
|
7671
|
+
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
7672
|
+
}
|
|
7673
|
+
}
|
|
7674
|
+
},
|
|
7675
|
+
children: [jsx(Box, {
|
|
7676
|
+
component: "span",
|
|
7677
|
+
sx: {
|
|
7678
|
+
flexGrow: 1,
|
|
7679
|
+
flexShrink: 1,
|
|
7680
|
+
minWidth: 0,
|
|
7681
|
+
overflow: 'hidden',
|
|
7682
|
+
textOverflow: 'ellipsis',
|
|
7683
|
+
whiteSpace: 'nowrap',
|
|
7684
|
+
paddingRight: '2px'
|
|
7685
|
+
},
|
|
7686
|
+
children: fullTitle
|
|
7687
|
+
}), panelId && jsx(Box, {
|
|
7688
|
+
component: "span",
|
|
7689
|
+
sx: {
|
|
7690
|
+
flexShrink: 0,
|
|
7691
|
+
ml: 1,
|
|
7692
|
+
fontStyle: 'normal',
|
|
7693
|
+
fontWeight: 400,
|
|
7694
|
+
whiteSpace: 'nowrap',
|
|
7695
|
+
color: isViewPresetDialogOpen ? 'geowebColors.text.inverse' : 'geowebColors.captions.captionStatus.rgba'
|
|
7696
|
+
},
|
|
7697
|
+
children: panelId
|
|
7698
|
+
})]
|
|
7699
|
+
})
|
|
7700
|
+
}), jsx(WorkspaceOptions, {
|
|
7701
|
+
handleSave: isEnabled ? onSave : undefined,
|
|
7702
|
+
handleDelete: isEnabled ? onDelete : undefined,
|
|
7703
|
+
handleSaveAs: isLoggedIn ? onSaveAs : undefined,
|
|
7704
|
+
handleEdit: isEnabled ? onEdit : undefined,
|
|
7705
|
+
handleReset: onReset,
|
|
7706
|
+
id: viewPresetOptionId
|
|
7707
|
+
})]
|
|
7708
|
+
}), jsx(Box, {
|
|
7709
|
+
sx: {
|
|
7710
|
+
display: 'flex',
|
|
7711
|
+
alignItems: 'center',
|
|
7712
|
+
pt: 0.72
|
|
7713
|
+
},
|
|
7714
|
+
children: jsx(LoadingIndicatorConnect, {
|
|
7715
|
+
panelId: panelId
|
|
7716
|
+
})
|
|
7717
|
+
})]
|
|
7718
|
+
})
|
|
7719
|
+
);
|
|
7720
|
+
};
|
|
7721
|
+
var WorkspaceViewTitleConnect = /*#__PURE__*/React.memo(WorkspaceViewTitleConnectNoMemo);
|
|
7722
|
+
|
|
7723
|
+
/* *
|
|
7724
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7725
|
+
* you may not use this file except in compliance with the License.
|
|
7726
|
+
* You may obtain a copy of the License at
|
|
7727
|
+
*
|
|
7728
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7729
|
+
*
|
|
7730
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7731
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7732
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7733
|
+
* See the License for the specific language governing permissions and
|
|
7734
|
+
* limitations under the License.
|
|
7735
|
+
*
|
|
7736
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7737
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
7738
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
7739
|
+
* */
|
|
7740
|
+
var getUniqueId = function getUniqueId(existingIds, count) {
|
|
7741
|
+
if (count === void 0) {
|
|
7742
|
+
count = 1;
|
|
7743
|
+
}
|
|
7744
|
+
var newId = count + "_screen";
|
|
7745
|
+
if (existingIds.indexOf(newId) !== -1) {
|
|
7746
|
+
return getUniqueId(existingIds, count + 1);
|
|
7747
|
+
}
|
|
7748
|
+
return newId;
|
|
7749
|
+
};
|
|
7750
|
+
var createBalancedMosaicNode = function createBalancedMosaicNode(currentNode) {
|
|
7751
|
+
var leaves = getLeaves(currentNode);
|
|
7752
|
+
return createBalancedTreeFromLeaves(leaves);
|
|
7753
|
+
};
|
|
7754
|
+
var closeDialogsWhenChangingPreset = function closeDialogsWhenChangingPreset(componentTypes, dispatch) {
|
|
7755
|
+
if (!componentTypes || componentTypes.length === 0 || componentTypes.some(function (componentType) {
|
|
7756
|
+
return componentType.toLowerCase().includes('viewloading');
|
|
7757
|
+
})) {
|
|
7758
|
+
return;
|
|
7759
|
+
}
|
|
7760
|
+
// Close all dialogs related to timeseries
|
|
7761
|
+
if (!componentTypes.some(function (componentType) {
|
|
7762
|
+
return componentType.toLowerCase().includes('timeseries');
|
|
7763
|
+
})) {
|
|
7764
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
7765
|
+
setOpen: false,
|
|
7766
|
+
type: uiTypes.DialogTypes.TimeSeriesManager
|
|
7767
|
+
}));
|
|
7768
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
7769
|
+
setOpen: false,
|
|
7770
|
+
type: uiTypes.DialogTypes.TimeSeriesSelect
|
|
7771
|
+
}));
|
|
7772
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
7773
|
+
setOpen: false,
|
|
7774
|
+
type: uiTypes.DialogTypes.TimeSeriesInfo
|
|
7775
|
+
}));
|
|
7776
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
7777
|
+
setOpen: false,
|
|
7778
|
+
type: uiTypes.DialogTypes.TimeSeriesLocationInfo
|
|
7779
|
+
}));
|
|
7780
|
+
}
|
|
7781
|
+
// Close all dialogs related to soundings
|
|
7782
|
+
if (!componentTypes.some(function (componentType) {
|
|
7783
|
+
return componentType.toLowerCase().includes('soundings');
|
|
7784
|
+
})) {
|
|
7785
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
7786
|
+
setOpen: false,
|
|
7787
|
+
type: uiTypes.DialogTypes.SoundingsLocations
|
|
7788
|
+
}));
|
|
7789
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
7790
|
+
setOpen: false,
|
|
7791
|
+
type: uiTypes.DialogTypes.SoundingsSources
|
|
7792
|
+
}));
|
|
7793
|
+
}
|
|
7794
|
+
// Close dialogs related to the warninglist
|
|
7795
|
+
if (!componentTypes.some(function (componentType) {
|
|
7796
|
+
return componentType.toLowerCase().includes('warninglist');
|
|
7797
|
+
}) && !componentTypes.some(function (componentType) {
|
|
7798
|
+
return componentType.toLowerCase().includes('map');
|
|
7799
|
+
})) {
|
|
7800
|
+
dispatch(uiActions.setToggleOpenDialog({
|
|
7801
|
+
setOpen: false,
|
|
7802
|
+
type: uiTypes.DialogTypes.PublicWarnings
|
|
7803
|
+
}));
|
|
7804
|
+
}
|
|
7805
|
+
};
|
|
7745
7806
|
|
|
7746
|
-
var
|
|
7747
|
-
var
|
|
7748
|
-
|
|
7749
|
-
updateViews = _ref.updateViews,
|
|
7750
|
-
activeWindowId = _ref.activeWindowId,
|
|
7751
|
-
setActiveWindowId = _ref.setActiveWindowId,
|
|
7752
|
-
_ref$isWorkspaceLoadi = _ref.isWorkspaceLoading,
|
|
7753
|
-
isWorkspaceLoading = _ref$isWorkspaceLoadi === void 0 ? false : _ref$isWorkspaceLoadi;
|
|
7807
|
+
var LinkMenuConnect = function LinkMenuConnect(_ref) {
|
|
7808
|
+
var panelId = _ref.panelId;
|
|
7809
|
+
var dispatch = useDispatch();
|
|
7754
7810
|
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7755
7811
|
t = _useWorkspaceTranslat.t;
|
|
7756
|
-
var
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
justifyContent: 'center',
|
|
7762
|
-
alignItems: 'center',
|
|
7763
|
-
height: '100%'
|
|
7764
|
-
},
|
|
7765
|
-
children: [jsx(WebAssetOff, {
|
|
7766
|
-
sx: {
|
|
7767
|
-
fontSize: '150px',
|
|
7768
|
-
margin: '20px'
|
|
7769
|
-
}
|
|
7770
|
-
}), jsx(Typography, {
|
|
7771
|
-
sx: {
|
|
7772
|
-
color: 'geowebColors.typographyAndIcons.text'
|
|
7773
|
-
},
|
|
7774
|
-
children: t('geoweb-welcome')
|
|
7775
|
-
})]
|
|
7812
|
+
var _React$useState = React__default.useState(null),
|
|
7813
|
+
anchorEl = _React$useState[0],
|
|
7814
|
+
setAnchorEl = _React$useState[1];
|
|
7815
|
+
var maps = useSelector(function (store) {
|
|
7816
|
+
return mapSelectors.getAllMapIds(store);
|
|
7776
7817
|
});
|
|
7777
|
-
|
|
7778
|
-
var
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
return
|
|
7818
|
+
var viewsById = useSelector(getViewsById);
|
|
7819
|
+
var selectedMapIds = useSelector(function (store) {
|
|
7820
|
+
return genericSelectors.getLinkedMaps(store, panelId);
|
|
7821
|
+
});
|
|
7822
|
+
var viewComponentType = useSelector(function (store) {
|
|
7823
|
+
return getViewComponentType(store, panelId);
|
|
7824
|
+
});
|
|
7825
|
+
var sharedFeature = useSelector(function (store) {
|
|
7826
|
+
return genericSelectors.getSelectedFeature(store.syncGroups, panelId);
|
|
7827
|
+
});
|
|
7828
|
+
var mapPinLocation = useSelector(function (store) {
|
|
7829
|
+
return mapSelectors.getPinLocation(store, selectedMapIds[0] || '');
|
|
7830
|
+
});
|
|
7831
|
+
var handleLinkViews = function handleLinkViews(event) {
|
|
7832
|
+
setAnchorEl(event.currentTarget);
|
|
7789
7833
|
};
|
|
7790
|
-
var
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7834
|
+
var handleMenuClose = function handleMenuClose() {
|
|
7835
|
+
setAnchorEl(null);
|
|
7836
|
+
};
|
|
7837
|
+
var handleMapSelect = function handleMapSelect(mapId) {
|
|
7838
|
+
var updatedMapIds = selectedMapIds.includes(mapId) ? selectedMapIds.filter(function (id) {
|
|
7839
|
+
return id !== mapId;
|
|
7840
|
+
}) : [].concat(selectedMapIds, [mapId]);
|
|
7841
|
+
dispatch(genericActions.updateLinkedMap({
|
|
7842
|
+
panelId: panelId,
|
|
7843
|
+
mapIds: updatedMapIds
|
|
7844
|
+
}));
|
|
7845
|
+
// Sync pin to newly added map for TimeSeries components
|
|
7846
|
+
if (!selectedMapIds.includes(mapId) && viewComponentType === 'TimeSeries') {
|
|
7847
|
+
// Observation station
|
|
7848
|
+
if (sharedFeature) {
|
|
7849
|
+
dispatch(mapActions.setMapPinLocation({
|
|
7850
|
+
mapId: mapId,
|
|
7851
|
+
mapPinLocation: {
|
|
7852
|
+
lon: sharedFeature.lon,
|
|
7853
|
+
lat: sharedFeature.lat
|
|
7854
|
+
}
|
|
7855
|
+
}));
|
|
7856
|
+
// Grid
|
|
7857
|
+
} else if (mapPinLocation) {
|
|
7858
|
+
dispatch(mapActions.setMapPinLocation({
|
|
7859
|
+
mapId: mapId,
|
|
7860
|
+
mapPinLocation: mapPinLocation
|
|
7861
|
+
}));
|
|
7862
|
+
}
|
|
7795
7863
|
}
|
|
7796
7864
|
};
|
|
7797
|
-
return
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7865
|
+
return jsxs(Fragment, {
|
|
7866
|
+
children: [linkComponentTypesConstants.supportedComponentTypesForLinking.includes(viewComponentType) && jsx(CustomIconButton, {
|
|
7867
|
+
onClick: handleLinkViews,
|
|
7868
|
+
"data-testid": "icon-button",
|
|
7869
|
+
tooltipTitle: "Link " + viewComponentType,
|
|
7870
|
+
sx: {
|
|
7871
|
+
marginLeft: 0.5,
|
|
7872
|
+
marginRight: 0.5
|
|
7804
7873
|
},
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7874
|
+
children: selectedMapIds.length > 0 ? jsx(Link, {
|
|
7875
|
+
"data-testid": "link-icon",
|
|
7876
|
+
style: {
|
|
7877
|
+
fill: anchorEl ? 'white' : undefined,
|
|
7878
|
+
backgroundColor: anchorEl ? '#186DFF' : undefined
|
|
7879
|
+
}
|
|
7880
|
+
}) : jsx(LinkOff, {
|
|
7881
|
+
"data-testid": "link-off-icon",
|
|
7882
|
+
style: {
|
|
7883
|
+
fill: anchorEl ? 'white' : undefined,
|
|
7884
|
+
backgroundColor: anchorEl ? '#186DFF' : undefined
|
|
7885
|
+
}
|
|
7886
|
+
})
|
|
7887
|
+
}), jsxs(Menu, {
|
|
7888
|
+
id: "map-select-menu",
|
|
7889
|
+
"data-testid": "map-select-menu",
|
|
7890
|
+
anchorEl: anchorEl,
|
|
7891
|
+
open: Boolean(anchorEl),
|
|
7892
|
+
onClose: handleMenuClose,
|
|
7893
|
+
keepMounted: true,
|
|
7894
|
+
children: [jsxs(Typography, {
|
|
7895
|
+
variant: "h6",
|
|
7896
|
+
style: {
|
|
7897
|
+
padding: '10px 15px 0',
|
|
7898
|
+
fontWeight: 'bold'
|
|
7899
|
+
},
|
|
7900
|
+
children: [t('workspace-link'), " - ", t('workspace-link-location-header')]
|
|
7901
|
+
}), jsx(List, {
|
|
7902
|
+
dense: true,
|
|
7903
|
+
children: maps.map(function (mapId) {
|
|
7904
|
+
var _viewsById$mapId;
|
|
7905
|
+
var labelId = "checkbox-link-label-" + mapId;
|
|
7906
|
+
return jsx(ListItem, {
|
|
7907
|
+
onClick: function onClick() {
|
|
7908
|
+
return handleMapSelect(mapId);
|
|
7909
|
+
},
|
|
7910
|
+
disablePadding: true,
|
|
7911
|
+
dense: true,
|
|
7912
|
+
divider: true,
|
|
7913
|
+
children: jsxs(ListItemButton, {
|
|
7914
|
+
role: "checkbox",
|
|
7915
|
+
dense: true,
|
|
7916
|
+
sx: {
|
|
7917
|
+
margin: 0,
|
|
7918
|
+
padding: '0 16px'
|
|
7834
7919
|
},
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7920
|
+
children: [jsx(ListItemIcon, {
|
|
7921
|
+
children: jsx(Checkbox, {
|
|
7922
|
+
edge: "start",
|
|
7923
|
+
tabIndex: -1,
|
|
7924
|
+
checked: selectedMapIds.includes(mapId),
|
|
7925
|
+
disableRipple: true,
|
|
7926
|
+
inputProps: {
|
|
7927
|
+
'aria-labelledby': labelId
|
|
7928
|
+
}
|
|
7929
|
+
})
|
|
7930
|
+
}), jsx(ListItemText, {
|
|
7931
|
+
id: labelId,
|
|
7932
|
+
primary: (_viewsById$mapId = viewsById[mapId]) == null ? void 0 : _viewsById$mapId.title,
|
|
7933
|
+
secondary: mapId
|
|
7934
|
+
})]
|
|
7935
|
+
})
|
|
7936
|
+
}, mapId);
|
|
7937
|
+
})
|
|
7938
|
+
})]
|
|
7939
|
+
})]
|
|
7854
7940
|
});
|
|
7855
7941
|
};
|
|
7856
|
-
var useControlActiveWindowId = function useControlActiveWindowId(screenConfig, activeWindowId, setActiveWindowId) {
|
|
7857
|
-
// When screenConfig.id changes it means a new preset was chosen.
|
|
7858
|
-
React.useEffect(function () {
|
|
7859
|
-
if (screenConfig.id !== '' && screenConfig.mosaicNode) {
|
|
7860
|
-
var mosaicNode = screenConfig.mosaicNode;
|
|
7861
|
-
while (!isString(mosaicNode)) {
|
|
7862
|
-
mosaicNode = mosaicNode.first;
|
|
7863
|
-
}
|
|
7864
|
-
setActiveWindowId(mosaicNode);
|
|
7865
|
-
}
|
|
7866
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7867
|
-
}, [screenConfig.id]);
|
|
7868
|
-
// If active window is no longer in screenConfig then set active window to first window
|
|
7869
|
-
React.useEffect(function () {
|
|
7870
|
-
var viewIds = screenConfig.views.allIds;
|
|
7871
|
-
if (activeWindowId !== undefined && viewIds && viewIds.length > 0 && !viewIds.includes(activeWindowId)) {
|
|
7872
|
-
setActiveWindowId(viewIds[0]);
|
|
7873
|
-
}
|
|
7874
|
-
}, [activeWindowId, screenConfig.views, screenConfig.views.allIds, setActiveWindowId]);
|
|
7875
|
-
};
|
|
7876
7942
|
|
|
7877
|
-
var
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
var
|
|
7892
|
-
|
|
7893
|
-
activeWindowId: activeWindowId
|
|
7894
|
-
}));
|
|
7895
|
-
}, [dispatch]);
|
|
7896
|
-
var activeWindowId = useSelector(uiSelectors.getActiveWindowId);
|
|
7943
|
+
var buttonStyle = {
|
|
7944
|
+
marginLeft: 0.5,
|
|
7945
|
+
marginRight: 0.5
|
|
7946
|
+
};
|
|
7947
|
+
var WorkspaceControls = function WorkspaceControls(_ref) {
|
|
7948
|
+
var panelId = _ref.panelId,
|
|
7949
|
+
createNode = _ref.createNode,
|
|
7950
|
+
path = _ref.path,
|
|
7951
|
+
_ref$shouldPreventClo = _ref.shouldPreventCloseView,
|
|
7952
|
+
shouldPreventCloseView = _ref$shouldPreventClo === void 0 ? false : _ref$shouldPreventClo,
|
|
7953
|
+
removeLinkedMap = _ref.removeLinkedMap;
|
|
7954
|
+
var confirmDialog = useConfirmationDialog();
|
|
7955
|
+
var _React$useContext = React.useContext(MosaicContext),
|
|
7956
|
+
actions = _React$useContext.mosaicActions;
|
|
7957
|
+
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
7958
|
+
t = _useWorkspaceTranslat.t;
|
|
7897
7959
|
var mosaicNode = useSelector(function (store) {
|
|
7898
7960
|
return getMosaicNode(store);
|
|
7899
7961
|
});
|
|
7900
|
-
var
|
|
7901
|
-
|
|
7902
|
-
|
|
7962
|
+
var _React$useState = React.useState(),
|
|
7963
|
+
stateAfterExpand = _React$useState[0],
|
|
7964
|
+
setStateAfterExpand = _React$useState[1];
|
|
7965
|
+
var _React$useState2 = React.useState(mosaicNode),
|
|
7966
|
+
stateBeforeExpand = _React$useState2[0],
|
|
7967
|
+
setStateBeforeExpand = _React$useState2[1];
|
|
7968
|
+
var _React$useState3 = React.useState(false),
|
|
7969
|
+
enableUnexpand = _React$useState3[0],
|
|
7970
|
+
setEnableUnexpand = _React$useState3[1];
|
|
7971
|
+
React.useEffect(function () {
|
|
7972
|
+
if (enableUnexpand) {
|
|
7973
|
+
if (stateAfterExpand === undefined) {
|
|
7974
|
+
setStateAfterExpand(mosaicNode);
|
|
7975
|
+
return;
|
|
7976
|
+
}
|
|
7977
|
+
if (!isEqual(mosaicNode, stateAfterExpand)) {
|
|
7978
|
+
setEnableUnexpand(false);
|
|
7979
|
+
setStateAfterExpand(undefined);
|
|
7980
|
+
}
|
|
7981
|
+
}
|
|
7982
|
+
}, [enableUnexpand, mosaicNode, stateAfterExpand]);
|
|
7983
|
+
var onClose = /*#__PURE__*/function () {
|
|
7984
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7985
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7986
|
+
while (1) switch (_context.prev = _context.next) {
|
|
7987
|
+
case 0:
|
|
7988
|
+
if (!shouldPreventCloseView) {
|
|
7989
|
+
_context.next = 7;
|
|
7990
|
+
break;
|
|
7991
|
+
}
|
|
7992
|
+
_context.next = 3;
|
|
7993
|
+
return confirmDialog({
|
|
7994
|
+
title: t('workspace-control-close-message-title'),
|
|
7995
|
+
description: t('workspace-control-close-message-description'),
|
|
7996
|
+
confirmLabel: t('workspace-control-close')
|
|
7997
|
+
});
|
|
7998
|
+
case 3:
|
|
7999
|
+
actions.remove(path);
|
|
8000
|
+
removeLinkedMap(panelId);
|
|
8001
|
+
_context.next = 9;
|
|
8002
|
+
break;
|
|
8003
|
+
case 7:
|
|
8004
|
+
actions.remove(path);
|
|
8005
|
+
removeLinkedMap(panelId);
|
|
8006
|
+
case 9:
|
|
8007
|
+
case "end":
|
|
8008
|
+
return _context.stop();
|
|
8009
|
+
}
|
|
8010
|
+
}, _callee);
|
|
7903
8011
|
}));
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
autoArrange();
|
|
7907
|
-
}, [autoArrange]);
|
|
7908
|
-
var componentTypes = useSelector(function (store) {
|
|
7909
|
-
return getComponentTypesFromActiveViews(store);
|
|
7910
|
-
});
|
|
7911
|
-
React__default.useEffect(function () {
|
|
7912
|
-
closeDialogsWhenChangingPreset(componentTypes, dispatch);
|
|
7913
|
-
}, [componentTypes, dispatch]);
|
|
7914
|
-
React__default.useEffect(function () {
|
|
7915
|
-
window.addEventListener('orientationchange', handleOrientationChange);
|
|
7916
|
-
return function () {
|
|
7917
|
-
return window.removeEventListener('orientationchange', handleOrientationChange);
|
|
8012
|
+
return function onClose() {
|
|
8013
|
+
return _ref2.apply(this, arguments);
|
|
7918
8014
|
};
|
|
7919
|
-
}
|
|
7920
|
-
return
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
8015
|
+
}();
|
|
8016
|
+
return jsxs(Fragment, {
|
|
8017
|
+
children: [jsx(LinkMenuConnect, {
|
|
8018
|
+
panelId: panelId
|
|
8019
|
+
}), jsx(CustomIconButton, {
|
|
8020
|
+
"data-testid": "split-horizontal-btn",
|
|
8021
|
+
sx: buttonStyle,
|
|
8022
|
+
onClick: function onClick() {
|
|
8023
|
+
var newNode = createNode();
|
|
8024
|
+
var previousNode = getAndAssertNodeAtPathExists(actions.getRoot(), path);
|
|
8025
|
+
actions.replaceWith(path, {
|
|
8026
|
+
direction: 'column',
|
|
8027
|
+
first: previousNode,
|
|
8028
|
+
second: newNode
|
|
8029
|
+
});
|
|
8030
|
+
},
|
|
8031
|
+
tooltipTitle: t('workspace-control-split-horizontal'),
|
|
8032
|
+
children: jsx(SplitVertical, {})
|
|
8033
|
+
}), jsx(CustomIconButton, {
|
|
8034
|
+
"data-testid": "split-vertical-btn",
|
|
8035
|
+
sx: buttonStyle,
|
|
8036
|
+
onClick: function onClick() {
|
|
8037
|
+
var newNode = createNode();
|
|
8038
|
+
var previousNode = getAndAssertNodeAtPathExists(actions.getRoot(), path);
|
|
8039
|
+
actions.replaceWith(path, {
|
|
8040
|
+
direction: 'row',
|
|
8041
|
+
first: previousNode,
|
|
8042
|
+
second: newNode
|
|
8043
|
+
});
|
|
8044
|
+
},
|
|
8045
|
+
tooltipTitle: t('workspace-control-split-vertical'),
|
|
8046
|
+
children: jsx(SplitHorizontal, {})
|
|
8047
|
+
}), !enableUnexpand || isString(mosaicNode) ? jsx(CustomIconButton, {
|
|
8048
|
+
"data-testid": "expand-btn",
|
|
8049
|
+
sx: buttonStyle,
|
|
8050
|
+
onClick: function onClick() {
|
|
8051
|
+
setStateBeforeExpand(mosaicNode);
|
|
8052
|
+
setEnableUnexpand(true);
|
|
8053
|
+
actions.expand(path, 70);
|
|
8054
|
+
},
|
|
8055
|
+
tooltipTitle: t('workspace-control-expand'),
|
|
8056
|
+
children: jsx(Expand, {})
|
|
8057
|
+
}) : jsx(CustomIconButton, {
|
|
8058
|
+
"data-testid": "unexpand-btn",
|
|
8059
|
+
sx: buttonStyle,
|
|
8060
|
+
onClick: function onClick() {
|
|
8061
|
+
var stateBeforeExpandCopy = isString(stateBeforeExpand) ? stateBeforeExpand : Object.assign({}, stateBeforeExpand);
|
|
8062
|
+
actions.replaceWith([], stateBeforeExpandCopy);
|
|
8063
|
+
},
|
|
8064
|
+
tooltipTitle: t('workspace-control-unexpand'),
|
|
8065
|
+
children: jsx(UnExpand, {})
|
|
8066
|
+
}), jsx(CustomIconButton, {
|
|
8067
|
+
"data-testid": "close-btn",
|
|
8068
|
+
sx: buttonStyle,
|
|
8069
|
+
onClick: onClose,
|
|
8070
|
+
tooltipTitle: t('workspace-control-close'),
|
|
8071
|
+
id: "close-window-button",
|
|
8072
|
+
children: jsx(Close, {})
|
|
8073
|
+
})]
|
|
8074
|
+
});
|
|
7973
8075
|
};
|
|
7974
8076
|
|
|
7975
|
-
var
|
|
7976
|
-
var
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
var
|
|
7983
|
-
|
|
7984
|
-
var workspacePresets = useSelector(function (store) {
|
|
7985
|
-
return getWorkspaceList(store);
|
|
8077
|
+
var WorkspaceTileConnect = /*#__PURE__*/React.memo(function (_ref) {
|
|
8078
|
+
var _ref$mosaicNodeId = _ref.mosaicNodeId,
|
|
8079
|
+
mosaicNodeId = _ref$mosaicNodeId === void 0 ? '' : _ref$mosaicNodeId,
|
|
8080
|
+
path = _ref.path,
|
|
8081
|
+
componentsLookUp = _ref.componentsLookUp;
|
|
8082
|
+
var dispatch = useDispatch();
|
|
8083
|
+
useFetchViewPresets(mosaicNodeId);
|
|
8084
|
+
var view = useSelector(function (store) {
|
|
8085
|
+
return getViewById(store, mosaicNodeId);
|
|
7986
8086
|
});
|
|
7987
|
-
var
|
|
7988
|
-
|
|
7989
|
-
return filterAndSortPresets(workspacePresets, selectedFilters, username, isAdmin);
|
|
7990
|
-
}, [workspacePresets, selectedFilters, username, isAdmin]);
|
|
7991
|
-
var currentView = useSelector(function (store) {
|
|
7992
|
-
return getWorkspaceState(store);
|
|
8087
|
+
var viewIds = useSelector(function (store) {
|
|
8088
|
+
return getViewIds(store);
|
|
7993
8089
|
});
|
|
7994
|
-
var
|
|
7995
|
-
return
|
|
8090
|
+
var shouldPreventCloseView = useSelector(function (store) {
|
|
8091
|
+
return getShouldPreventClose(store, mosaicNodeId);
|
|
7996
8092
|
});
|
|
7997
|
-
var
|
|
7998
|
-
return
|
|
8093
|
+
var isViewPresetDialogOpen = useSelector(function (store) {
|
|
8094
|
+
return getIsViewPresetListDialogOpen(store, mosaicNodeId);
|
|
7999
8095
|
});
|
|
8000
|
-
var
|
|
8001
|
-
return
|
|
8096
|
+
var isViewPresetsFetching = useSelector(function (store) {
|
|
8097
|
+
return getViewPresetsIsFetching(store, mosaicNodeId);
|
|
8002
8098
|
});
|
|
8003
|
-
var
|
|
8004
|
-
return
|
|
8099
|
+
var errorViewPreset = useSelector(function (store) {
|
|
8100
|
+
return getViewPresetDetailError(store, mosaicNodeId);
|
|
8005
8101
|
});
|
|
8006
|
-
var
|
|
8007
|
-
|
|
8008
|
-
t = _useWorkspaceTranslat.t;
|
|
8009
|
-
var fetchWorkspaceList = React.useCallback(function () {
|
|
8010
|
-
var filterParams = constructFilterParams([], workspaceSearchQuery);
|
|
8011
|
-
dispatch(workspaceListActions.fetchWorkspaceList(filterParams));
|
|
8012
|
-
}, [dispatch, workspaceSearchQuery]);
|
|
8013
|
-
var fetchWorkspace = React.useCallback(function (workspaceId) {
|
|
8014
|
-
dispatch(workspaceActions.fetchWorkspace({
|
|
8015
|
-
workspaceId: workspaceId
|
|
8016
|
-
}));
|
|
8017
|
-
}, [dispatch]);
|
|
8018
|
-
var setWorkspaceActionDialogOptions = React.useCallback(function (dialogOptions) {
|
|
8019
|
-
dispatch(workspaceListActions.openWorkspaceActionDialogOptions(dialogOptions));
|
|
8102
|
+
var addView = React.useCallback(function (view) {
|
|
8103
|
+
dispatch(workspaceActions.setNewWorkspaceView(view));
|
|
8020
8104
|
}, [dispatch]);
|
|
8021
|
-
var
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8105
|
+
var registerView = React.useCallback(function (_ref2) {
|
|
8106
|
+
var panelId = _ref2.panelId,
|
|
8107
|
+
mapPresetId = _ref2.mapPresetId;
|
|
8108
|
+
dispatch(viewPresetActions.registerViewPreset({
|
|
8109
|
+
panelId: panelId,
|
|
8110
|
+
viewPresetId: mapPresetId
|
|
8026
8111
|
}));
|
|
8027
|
-
}, [dispatch, isAdmin]);
|
|
8028
|
-
var setSelectAllFilterChip = React.useCallback(function () {
|
|
8029
|
-
dispatch(workspaceListActions.setSelectAllFilterChip());
|
|
8030
8112
|
}, [dispatch]);
|
|
8031
|
-
var
|
|
8032
|
-
|
|
8033
|
-
|
|
8113
|
+
var unregisterView = React.useCallback(function (_ref3) {
|
|
8114
|
+
var panelId = _ref3.panelId;
|
|
8115
|
+
dispatch(viewPresetActions.unregisterViewPreset({
|
|
8116
|
+
panelId: panelId
|
|
8034
8117
|
}));
|
|
8035
8118
|
}, [dispatch]);
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
newMapPresetText: t('workspace-mappreset-new'),
|
|
8046
|
-
newWorkspaceText: t('workspace-new')
|
|
8119
|
+
var removeLinkedMap = React.useCallback(function (panelId) {
|
|
8120
|
+
dispatch(genericActions.removeLinkedMap(panelId));
|
|
8121
|
+
}, [dispatch]);
|
|
8122
|
+
var toggleViewPresetDialog = React.useCallback(function (_ref4) {
|
|
8123
|
+
var panelId = _ref4.panelId,
|
|
8124
|
+
isViewPresetDialogOpen = _ref4.isViewPresetDialogOpen;
|
|
8125
|
+
dispatch(viewPresetActions.toggleViewPresetListDialog({
|
|
8126
|
+
panelId: panelId,
|
|
8127
|
+
isViewPresetListDialogOpen: isViewPresetDialogOpen
|
|
8047
8128
|
}));
|
|
8048
|
-
}, [dispatch
|
|
8049
|
-
var
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
};
|
|
8056
|
-
var onClickFilterChip = function onClickFilterChip(id, shouldSelect) {
|
|
8057
|
-
if (id === 'all') {
|
|
8058
|
-
if (shouldSelect) {
|
|
8059
|
-
setSelectAllFilterChip();
|
|
8060
|
-
}
|
|
8061
|
-
} else {
|
|
8062
|
-
toggleSelectFilterChip(id, shouldSelect);
|
|
8063
|
-
}
|
|
8064
|
-
};
|
|
8065
|
-
var onClickWorkspacePresetOption = function onClickWorkspacePresetOption(presetId, workspaceAction) {
|
|
8066
|
-
// If affectedPreset is the FE defined `New workspace` - use the definition from FE instead of BE
|
|
8067
|
-
var affectedPreset = presetId === getEmptyMapWorkspace(t).id ? getEmptyMapWorkspace(t) : workspacePresets.find(function (preset) {
|
|
8068
|
-
return preset.id === presetId;
|
|
8129
|
+
}, [dispatch]);
|
|
8130
|
+
var createNode = React.useCallback(function () {
|
|
8131
|
+
var newId = getUniqueId(viewIds);
|
|
8132
|
+
addView({
|
|
8133
|
+
componentType: 'Map',
|
|
8134
|
+
mosaicNodeId: mosaicNodeId,
|
|
8135
|
+
newId: newId
|
|
8069
8136
|
});
|
|
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
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
}), auth).then(function () {
|
|
8119
|
-
dispatch(workspaceListActions.onSuccessWorkspacePresetAction({
|
|
8120
|
-
workspaceId: presetId,
|
|
8121
|
-
action: WorkspacePresetAction.SHARE,
|
|
8122
|
-
title: presetTitle,
|
|
8123
|
-
scope: scope,
|
|
8124
|
-
is_shared: preset.is_shared
|
|
8125
|
-
}));
|
|
8126
|
-
fetchWorkspaceList();
|
|
8127
|
-
})["catch"](function (error) {
|
|
8128
|
-
dispatch(workspaceListActions.onErrorWorkspacePresetAction({
|
|
8129
|
-
error: {
|
|
8130
|
-
message: "" + error,
|
|
8131
|
-
type: WorkspaceListErrorType.VERBATIM_ERROR,
|
|
8132
|
-
category: WorkspaceListErrorCategory.GENERIC
|
|
8133
|
-
}
|
|
8134
|
-
}));
|
|
8135
|
-
});
|
|
8136
|
-
});
|
|
8137
|
-
break;
|
|
8138
|
-
}
|
|
8139
|
-
case WorkspacePresetAction.OPEN_TAB:
|
|
8140
|
-
{
|
|
8141
|
-
var url = getWorkspaceRouteUrl(presetId);
|
|
8142
|
-
window.open(url, '_blank');
|
|
8143
|
-
break;
|
|
8144
|
-
}
|
|
8145
|
-
}
|
|
8146
|
-
};
|
|
8147
|
-
var isAllSelected = workspaceListFilters.length > 0 && workspaceListFilters.every(function (filter) {
|
|
8148
|
-
return filter.isSelected;
|
|
8149
|
-
});
|
|
8150
|
-
var shouldHideNewWorkspace = !isAllSelected || workspaceSearchQuery.length > 0;
|
|
8151
|
-
return jsxs(Box, {
|
|
8152
|
-
"data-testid": "workspace-selectlist-connect",
|
|
8153
|
-
style: {
|
|
8154
|
-
display: 'flex',
|
|
8155
|
-
flexDirection: 'column',
|
|
8156
|
-
height: '100%'
|
|
8157
|
-
},
|
|
8158
|
-
tabIndex: 0,
|
|
8159
|
-
children: [isFetching && jsx(LinearProgress, {
|
|
8137
|
+
return newId;
|
|
8138
|
+
}, [addView, mosaicNodeId, viewIds]);
|
|
8139
|
+
var title = (view == null ? void 0 : view.title) || (view == null ? void 0 : view.id) || mosaicNodeId;
|
|
8140
|
+
React.useEffect(function () {
|
|
8141
|
+
var viewPresetId = (view == null ? void 0 : view.id) || '';
|
|
8142
|
+
registerView({
|
|
8143
|
+
panelId: mosaicNodeId,
|
|
8144
|
+
mapPresetId: viewPresetId
|
|
8145
|
+
});
|
|
8146
|
+
return function () {
|
|
8147
|
+
unregisterView({
|
|
8148
|
+
panelId: mosaicNodeId
|
|
8149
|
+
});
|
|
8150
|
+
};
|
|
8151
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8152
|
+
}, [registerView, unregisterView]);
|
|
8153
|
+
// generic componentsLookUp
|
|
8154
|
+
var genericComponentsLookupResult = React.useMemo(function () {
|
|
8155
|
+
return componentsLookUp({
|
|
8156
|
+
title: title,
|
|
8157
|
+
id: mosaicNodeId,
|
|
8158
|
+
componentType: view == null ? void 0 : view.componentType,
|
|
8159
|
+
initialProps: view == null ? void 0 : view.initialProps
|
|
8160
|
+
});
|
|
8161
|
+
}, [componentsLookUp, mosaicNodeId, title, view == null ? void 0 : view.componentType, view == null ? void 0 : view.initialProps]);
|
|
8162
|
+
// default componentsLookUp
|
|
8163
|
+
var defaultComponentsLookupResult = React.useMemo(function () {
|
|
8164
|
+
return defaultComponentsLookUp({
|
|
8165
|
+
viewPresetId: view == null ? void 0 : view.id,
|
|
8166
|
+
componentType: view == null ? void 0 : view.componentType,
|
|
8167
|
+
mosaicNodeId: mosaicNodeId
|
|
8168
|
+
});
|
|
8169
|
+
}, [mosaicNodeId, view == null ? void 0 : view.componentType, view == null ? void 0 : view.id]);
|
|
8170
|
+
return jsxs(MosaicWindow, {
|
|
8171
|
+
path: path,
|
|
8172
|
+
createNode: createNode,
|
|
8173
|
+
title: jsx(WorkspaceViewTitleConnect, {
|
|
8174
|
+
panelId: mosaicNodeId,
|
|
8175
|
+
isViewPresetDialogOpen: isViewPresetDialogOpen || false
|
|
8176
|
+
}),
|
|
8177
|
+
toolbarControls: jsx(WorkspaceControls, {
|
|
8178
|
+
panelId: mosaicNodeId,
|
|
8179
|
+
createNode: createNode,
|
|
8180
|
+
path: path,
|
|
8181
|
+
shouldPreventCloseView: shouldPreventCloseView,
|
|
8182
|
+
removeLinkedMap: removeLinkedMap
|
|
8183
|
+
}),
|
|
8184
|
+
children: [isViewPresetsFetching && jsx(LinearProgress, {
|
|
8160
8185
|
"data-testid": "loading-bar",
|
|
8161
8186
|
color: "secondary",
|
|
8162
8187
|
sx: {
|
|
8163
8188
|
position: 'absolute',
|
|
8164
8189
|
width: '100%',
|
|
8165
8190
|
top: 0,
|
|
8166
|
-
|
|
8191
|
+
zIndex: 1001
|
|
8167
8192
|
}
|
|
8168
|
-
}),
|
|
8169
|
-
|
|
8170
|
-
|
|
8193
|
+
}), errorViewPreset && jsx(Box, {
|
|
8194
|
+
sx: {
|
|
8195
|
+
position: 'absolute',
|
|
8196
|
+
left: 0,
|
|
8197
|
+
right: 0,
|
|
8198
|
+
zIndex: 1002
|
|
8171
8199
|
},
|
|
8172
|
-
children: jsx(AlertBanner,
|
|
8173
|
-
title:
|
|
8174
|
-
GENERIC: '',
|
|
8175
|
-
AUTH: t('workspace-error-auth')
|
|
8176
|
-
}[error.category]) != null ? _GENERIC$AUTH$error$c : t('workspace-error-fetch'),
|
|
8177
|
-
info: error.type === WorkspaceListErrorType.TRANSLATABLE_ERROR ? t(error.key, error.params) : error.message,
|
|
8200
|
+
children: jsx(AlertBanner, {
|
|
8201
|
+
title: errorViewPreset,
|
|
8178
8202
|
shouldClose: true
|
|
8179
|
-
}
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
}), jsxs(Box, {
|
|
8188
|
-
sx: {
|
|
8189
|
-
display: 'flex',
|
|
8190
|
-
flexDirection: 'column',
|
|
8191
|
-
height: '100%',
|
|
8192
|
-
padding: 1,
|
|
8193
|
-
overflow: 'hidden'
|
|
8203
|
+
})
|
|
8204
|
+
}), defaultComponentsLookupResult, genericComponentsLookupResult, jsx(ViewPresetMenu, {
|
|
8205
|
+
panelId: mosaicNodeId,
|
|
8206
|
+
closeMenu: function closeMenu() {
|
|
8207
|
+
toggleViewPresetDialog({
|
|
8208
|
+
panelId: mosaicNodeId,
|
|
8209
|
+
isViewPresetDialogOpen: false
|
|
8210
|
+
});
|
|
8194
8211
|
},
|
|
8195
|
-
|
|
8196
|
-
sx: {
|
|
8197
|
-
marginBottom: 1
|
|
8198
|
-
},
|
|
8199
|
-
children: [jsx(Box, {
|
|
8200
|
-
sx: {
|
|
8201
|
-
display: 'flex',
|
|
8202
|
-
width: '100%'
|
|
8203
|
-
},
|
|
8204
|
-
children: jsx(Filter, {
|
|
8205
|
-
filters: workspaceListFilters,
|
|
8206
|
-
onClickFilterChip: onClickFilterChip,
|
|
8207
|
-
isAllSelected: isAllSelected,
|
|
8208
|
-
searchQuery: workspaceSearchQuery,
|
|
8209
|
-
onSearch: searchFilter
|
|
8210
|
-
})
|
|
8211
|
-
}), jsx(Box, {
|
|
8212
|
-
sx: {
|
|
8213
|
-
display: 'flex',
|
|
8214
|
-
justifyContent: 'flex-start'
|
|
8215
|
-
},
|
|
8216
|
-
children: jsx(LastUpdateTime, {
|
|
8217
|
-
onPressRefresh: function onPressRefresh() {
|
|
8218
|
-
return fetchWorkspaceList();
|
|
8219
|
-
},
|
|
8220
|
-
hideLabel: true
|
|
8221
|
-
})
|
|
8222
|
-
})]
|
|
8223
|
-
}), jsx(Box, {
|
|
8224
|
-
sx: {
|
|
8225
|
-
flexGrow: 1,
|
|
8226
|
-
minHeight: 0
|
|
8227
|
-
},
|
|
8228
|
-
children: jsx(WorkspaceSelectList, {
|
|
8229
|
-
workspacePresets: filteredPresets,
|
|
8230
|
-
currentSelectedId: currentView.id || '',
|
|
8231
|
-
onClickWorkspacePreset: onClickWorkspacePreset,
|
|
8232
|
-
onClickWorkspacePresetOption: onClickWorkspacePresetOption,
|
|
8233
|
-
hideNewWorkspace: shouldHideNewWorkspace,
|
|
8234
|
-
isEditable: isLoggedIn,
|
|
8235
|
-
isAdmin: isAdmin,
|
|
8236
|
-
searchQuery: workspaceSearchQuery
|
|
8237
|
-
})
|
|
8238
|
-
})]
|
|
8212
|
+
isOpen: isViewPresetDialogOpen
|
|
8239
8213
|
})]
|
|
8240
8214
|
});
|
|
8241
|
-
};
|
|
8215
|
+
}, isEqual);
|
|
8242
8216
|
|
|
8243
|
-
var
|
|
8244
|
-
var
|
|
8245
|
-
|
|
8246
|
-
|
|
8217
|
+
var WorkspaceView = function WorkspaceView(_ref) {
|
|
8218
|
+
var screenConfig = _ref.screenConfig,
|
|
8219
|
+
componentsLookUp = _ref.componentsLookUp,
|
|
8220
|
+
updateViews = _ref.updateViews,
|
|
8221
|
+
activeWindowId = _ref.activeWindowId,
|
|
8222
|
+
setActiveWindowId = _ref.setActiveWindowId,
|
|
8223
|
+
_ref$isWorkspaceLoadi = _ref.isWorkspaceLoading,
|
|
8224
|
+
isWorkspaceLoading = _ref$isWorkspaceLoadi === void 0 ? false : _ref$isWorkspaceLoadi;
|
|
8247
8225
|
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
8248
8226
|
t = _useWorkspaceTranslat.t;
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
hasLayout: false,
|
|
8258
|
-
resizableDefaultSize: {
|
|
8259
|
-
width: 380,
|
|
8260
|
-
height: '90%'
|
|
8227
|
+
var EmptyView = !isWorkspaceLoading && jsxs(Box, {
|
|
8228
|
+
sx: {
|
|
8229
|
+
backgroundColor: 'geowebColors.background.surface',
|
|
8230
|
+
display: 'flex',
|
|
8231
|
+
flexDirection: 'column',
|
|
8232
|
+
justifyContent: 'center',
|
|
8233
|
+
alignItems: 'center',
|
|
8234
|
+
height: '100%'
|
|
8261
8235
|
},
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
}
|
|
8267
|
-
},
|
|
8268
|
-
root: {
|
|
8269
|
-
style: {
|
|
8270
|
-
top: 40
|
|
8271
|
-
}
|
|
8236
|
+
children: [jsx(WebAssetOff, {
|
|
8237
|
+
sx: {
|
|
8238
|
+
fontSize: '150px',
|
|
8239
|
+
margin: '20px'
|
|
8272
8240
|
}
|
|
8273
|
-
},
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
title: t('workspace-menu'),
|
|
8277
|
-
onClose: closeMenu,
|
|
8278
|
-
style: {
|
|
8279
|
-
width: '100%',
|
|
8280
|
-
height: '100%'
|
|
8281
|
-
},
|
|
8282
|
-
onClick: function onClick(event) {
|
|
8283
|
-
event.stopPropagation();
|
|
8241
|
+
}), jsx(Typography, {
|
|
8242
|
+
sx: {
|
|
8243
|
+
color: 'geowebColors.typographyAndIcons.text'
|
|
8284
8244
|
},
|
|
8285
|
-
children:
|
|
8286
|
-
})
|
|
8245
|
+
children: t('geoweb-welcome')
|
|
8246
|
+
})]
|
|
8287
8247
|
});
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8248
|
+
useControlActiveWindowId(screenConfig, activeWindowId, setActiveWindowId);
|
|
8249
|
+
var getNewViewId = function getNewViewId(element, viewId) {
|
|
8250
|
+
if (element instanceof Element) {
|
|
8251
|
+
// Check if a windows close button was clicked
|
|
8252
|
+
var target = element.closest('#close-window-button');
|
|
8253
|
+
if (target) {
|
|
8254
|
+
var viewIds = screenConfig.views.allIds;
|
|
8255
|
+
var newViewId = viewIds.length === 0 ? undefined : activeWindowId;
|
|
8256
|
+
return newViewId;
|
|
8257
|
+
}
|
|
8258
|
+
}
|
|
8259
|
+
return viewId;
|
|
8297
8260
|
};
|
|
8298
|
-
var
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8261
|
+
var handleClickOnWindow = function handleClickOnWindow(event, viewId) {
|
|
8262
|
+
var target = event.target;
|
|
8263
|
+
var newViewId = getNewViewId(target, viewId);
|
|
8264
|
+
if (newViewId !== activeWindowId) {
|
|
8265
|
+
setActiveWindowId(newViewId);
|
|
8266
|
+
}
|
|
8267
|
+
};
|
|
8268
|
+
return jsx(Box, {
|
|
8269
|
+
sx: {
|
|
8270
|
+
height: '100%',
|
|
8271
|
+
'.geoweb-mosaic .mosaic-window-title': {
|
|
8272
|
+
fontWeight: 'bold',
|
|
8273
|
+
fontSize: '12px',
|
|
8274
|
+
userSelect: 'none'
|
|
8275
|
+
},
|
|
8276
|
+
'.geoweb-mosaic .mosaic-window-body': {
|
|
8277
|
+
backgroundColor: 'geowebColors.background.surfaceApp'
|
|
8278
|
+
}
|
|
8279
|
+
},
|
|
8280
|
+
children: jsx(Mosaic, {
|
|
8281
|
+
className: "geoweb-mosaic",
|
|
8282
|
+
zeroStateView: EmptyView || undefined,
|
|
8283
|
+
initialValue: screenConfig.mosaicNode,
|
|
8284
|
+
renderTile: function renderTile(viewId, path) {
|
|
8285
|
+
var windowIsActive = viewId === activeWindowId;
|
|
8286
|
+
return jsx(Box, {
|
|
8287
|
+
onClick: function onClick(event) {
|
|
8288
|
+
return handleClickOnWindow(event, viewId);
|
|
8289
|
+
},
|
|
8290
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
8291
|
+
sx: function sx(theme) {
|
|
8292
|
+
return {
|
|
8293
|
+
'> *': {
|
|
8294
|
+
height: '100%',
|
|
8295
|
+
width: '100%'
|
|
8296
|
+
},
|
|
8297
|
+
'.mosaic-window .mosaic-window-toolbar': {
|
|
8298
|
+
backgroundColor: windowIsActive ? theme.palette.geowebColors.workspace.activeWindow : theme.palette.geowebColors.workspace.inactiveWindow
|
|
8299
|
+
},
|
|
8300
|
+
'.mosaic-window-toolbar .MuiSvgIcon-root': {
|
|
8301
|
+
fill: windowIsActive ? theme.palette.geowebColors.buttons.flat["default"].color : theme.palette.geowebColors.buttons.flat.disabled.color
|
|
8302
|
+
},
|
|
8303
|
+
'#close-window-button .MuiSvgIcon-root': {
|
|
8304
|
+
fill: theme.palette.geowebColors.buttons.flat.disabled.color
|
|
8305
|
+
},
|
|
8306
|
+
'.mosaic-window-toolbar .mosaic-window-title': {
|
|
8307
|
+
color: windowIsActive ? theme.palette.geowebColors.typographyAndIcons.text : theme.palette.geowebColors.typographyAndIcons.inactiveText
|
|
8308
|
+
}
|
|
8309
|
+
};
|
|
8310
|
+
},
|
|
8311
|
+
children: jsx(WorkspaceTileConnect, {
|
|
8312
|
+
mosaicNodeId: viewId,
|
|
8313
|
+
path: path,
|
|
8314
|
+
componentsLookUp: componentsLookUp
|
|
8315
|
+
})
|
|
8316
|
+
});
|
|
8306
8317
|
},
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
variant: "tool",
|
|
8315
|
-
tooltipTitle: tooltipTitle,
|
|
8316
|
-
sx: {
|
|
8317
|
-
'&&': {
|
|
8318
|
-
backgroundColor: !showMenu ? 'transparent' : undefined,
|
|
8319
|
-
'&:hover': {
|
|
8320
|
-
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
8321
|
-
}
|
|
8322
|
-
}
|
|
8323
|
-
},
|
|
8324
|
-
children: jsx(PresetWorkspace, {})
|
|
8325
|
-
})
|
|
8326
|
-
}), jsx(WorkspaceMenu, {
|
|
8327
|
-
isOpen: showMenu,
|
|
8328
|
-
closeMenu: onCloseMenu
|
|
8329
|
-
})]
|
|
8318
|
+
onRelease: function onRelease(node) {
|
|
8319
|
+
return updateViews(node);
|
|
8320
|
+
},
|
|
8321
|
+
resize: {
|
|
8322
|
+
minimumPaneSizePercentage: screenConfig.minimumPaneSizePercentage || 20
|
|
8323
|
+
}
|
|
8324
|
+
})
|
|
8330
8325
|
});
|
|
8331
8326
|
};
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8342
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8343
|
-
* See the License for the specific language governing permissions and
|
|
8344
|
-
* limitations under the License.
|
|
8345
|
-
*
|
|
8346
|
-
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8347
|
-
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
8348
|
-
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
8349
|
-
* */
|
|
8350
|
-
var useFetchWorkspacePresets = function useFetchWorkspacePresets() {
|
|
8351
|
-
var dispatch = useDispatch();
|
|
8352
|
-
var _useAuthenticationCon = useAuthenticationContext(),
|
|
8353
|
-
currentRole = _useAuthenticationCon.currentRole;
|
|
8354
|
-
var isAdmin = (currentRole == null ? void 0 : currentRole.name) === GEOWEB_ROLE_PRESETS_ADMIN.name;
|
|
8355
|
-
var lastAdmin = usePrevious(isAdmin);
|
|
8356
|
-
var workspaceSearchQuery = useSelector(getWorkspaceListSearchQuery);
|
|
8357
|
-
var prevSearch = usePrevious(workspaceSearchQuery);
|
|
8358
|
-
var fetchWorkspacePresets = useCallback(function (params) {
|
|
8359
|
-
dispatch(workspaceListActions.fetchWorkspaceList(params));
|
|
8360
|
-
}, [dispatch]);
|
|
8361
|
-
useEffect(function () {
|
|
8362
|
-
if (workspaceSearchQuery !== prevSearch) {
|
|
8363
|
-
var filterParams = constructFilterParams([], workspaceSearchQuery);
|
|
8364
|
-
fetchWorkspacePresets(filterParams);
|
|
8327
|
+
var useControlActiveWindowId = function useControlActiveWindowId(screenConfig, activeWindowId, setActiveWindowId) {
|
|
8328
|
+
// When screenConfig.id changes it means a new preset was chosen.
|
|
8329
|
+
React.useEffect(function () {
|
|
8330
|
+
if (screenConfig.id !== '' && screenConfig.mosaicNode) {
|
|
8331
|
+
var mosaicNode = screenConfig.mosaicNode;
|
|
8332
|
+
while (!isString(mosaicNode)) {
|
|
8333
|
+
mosaicNode = mosaicNode.first;
|
|
8334
|
+
}
|
|
8335
|
+
setActiveWindowId(mosaicNode);
|
|
8365
8336
|
}
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
}, {
|
|
8374
|
-
id: PresetFilterType.personal,
|
|
8375
|
-
isSelected: !isAdmin
|
|
8376
|
-
}, {
|
|
8377
|
-
id: PresetFilterType.shared,
|
|
8378
|
-
isSelected: true
|
|
8379
|
-
}];
|
|
8380
|
-
dispatch(workspaceListActions.setFilterChips(filters));
|
|
8337
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8338
|
+
}, [screenConfig.id]);
|
|
8339
|
+
// If active window is no longer in screenConfig then set active window to first window
|
|
8340
|
+
React.useEffect(function () {
|
|
8341
|
+
var viewIds = screenConfig.views.allIds;
|
|
8342
|
+
if (activeWindowId !== undefined && viewIds && viewIds.length > 0 && !viewIds.includes(activeWindowId)) {
|
|
8343
|
+
setActiveWindowId(viewIds[0]);
|
|
8381
8344
|
}
|
|
8382
|
-
}, [
|
|
8345
|
+
}, [activeWindowId, screenConfig.views, screenConfig.views.allIds, setActiveWindowId]);
|
|
8383
8346
|
};
|
|
8384
8347
|
|
|
8385
|
-
var
|
|
8348
|
+
var WorkspaceViewConnect = function WorkspaceViewConnect(_ref) {
|
|
8349
|
+
var componentsLookUp = _ref.componentsLookUp;
|
|
8386
8350
|
var dispatch = useDispatch();
|
|
8387
|
-
var
|
|
8388
|
-
return
|
|
8351
|
+
var isWorkspaceLoading$1 = useSelector(function (store) {
|
|
8352
|
+
return isWorkspaceLoading(store);
|
|
8389
8353
|
});
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8354
|
+
var screenConfig = useSelector(function (store) {
|
|
8355
|
+
return getWorkspaceState(store);
|
|
8356
|
+
});
|
|
8357
|
+
var updateViews = useCallback(function (currentNode) {
|
|
8358
|
+
dispatch(workspaceActions.updateWorkspaceViews({
|
|
8359
|
+
mosaicNode: currentNode
|
|
8394
8360
|
}));
|
|
8395
8361
|
}, [dispatch]);
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8362
|
+
var setActiveWindowId = useCallback(function (activeWindowId) {
|
|
8363
|
+
dispatch(uiActions.setActiveWindowId({
|
|
8364
|
+
activeWindowId: activeWindowId
|
|
8365
|
+
}));
|
|
8366
|
+
}, [dispatch]);
|
|
8367
|
+
var activeWindowId = useSelector(uiSelectors.getActiveWindowId);
|
|
8368
|
+
var mosaicNode = useSelector(function (store) {
|
|
8369
|
+
return getMosaicNode(store);
|
|
8370
|
+
});
|
|
8371
|
+
var autoArrange = useCallback(function () {
|
|
8372
|
+
dispatch(workspaceActions.updateWorkspaceViews({
|
|
8373
|
+
mosaicNode: createBalancedMosaicNode(mosaicNode)
|
|
8374
|
+
}));
|
|
8375
|
+
}, [dispatch, mosaicNode]);
|
|
8376
|
+
var handleOrientationChange = React__default.useCallback(function () {
|
|
8377
|
+
autoArrange();
|
|
8378
|
+
}, [autoArrange]);
|
|
8379
|
+
var componentTypes = useSelector(function (store) {
|
|
8380
|
+
return getComponentTypesFromActiveViews(store);
|
|
8381
|
+
});
|
|
8382
|
+
React__default.useEffect(function () {
|
|
8383
|
+
closeDialogsWhenChangingPreset(componentTypes, dispatch);
|
|
8384
|
+
}, [componentTypes, dispatch]);
|
|
8385
|
+
React__default.useEffect(function () {
|
|
8386
|
+
window.addEventListener('orientationchange', handleOrientationChange);
|
|
8387
|
+
return function () {
|
|
8388
|
+
return window.removeEventListener('orientationchange', handleOrientationChange);
|
|
8389
|
+
};
|
|
8390
|
+
}, [handleOrientationChange]);
|
|
8391
|
+
return jsx(WorkspaceView, {
|
|
8392
|
+
screenConfig: screenConfig,
|
|
8393
|
+
componentsLookUp: componentsLookUp,
|
|
8394
|
+
updateViews: updateViews,
|
|
8395
|
+
activeWindowId: activeWindowId,
|
|
8396
|
+
setActiveWindowId: setActiveWindowId,
|
|
8397
|
+
isWorkspaceLoading: isWorkspaceLoading$1
|
|
8399
8398
|
});
|
|
8400
8399
|
};
|
|
8401
8400
|
|
|
8402
8401
|
var WorkspaceOptionsConnect = function WorkspaceOptionsConnect(_ref) {
|
|
8403
8402
|
var title = _ref.title,
|
|
8404
|
-
|
|
8405
|
-
workspaceId = _ref.workspaceId,
|
|
8406
|
-
appTitle = _ref.appTitle;
|
|
8403
|
+
workspaceId = _ref.workspaceId;
|
|
8407
8404
|
var dispatch = useDispatch();
|
|
8408
8405
|
var store = useStore();
|
|
8409
|
-
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
8410
|
-
t = _useWorkspaceTranslat.t;
|
|
8411
8406
|
var _useAuthenticationCon = useAuthenticationContext(),
|
|
8412
8407
|
currentRole = _useAuthenticationCon.currentRole,
|
|
8413
8408
|
auth = _useAuthenticationCon.auth;
|
|
8414
8409
|
var isAdmin = (currentRole == null ? void 0 : currentRole.name) === GEOWEB_ROLE_PRESETS_ADMIN.name;
|
|
8415
8410
|
var _useAuthenticationCon2 = useAuthenticationContext(),
|
|
8416
8411
|
isLoggedIn = _useAuthenticationCon2.isLoggedIn;
|
|
8417
|
-
var hasChanges = useSelector(function (store) {
|
|
8418
|
-
return hasWorkspaceChanges(store);
|
|
8419
|
-
});
|
|
8420
8412
|
var workspaceScope = useSelector(function (store) {
|
|
8421
8413
|
return getSelectedWorkspaceScope(store);
|
|
8422
8414
|
});
|
|
@@ -8424,19 +8416,15 @@ var WorkspaceOptionsConnect = function WorkspaceOptionsConnect(_ref) {
|
|
|
8424
8416
|
return getWorkspaceData(store);
|
|
8425
8417
|
});
|
|
8426
8418
|
var currentWorkspacePreset = useSelector(function (store) {
|
|
8427
|
-
return
|
|
8419
|
+
return workspaceId ? getWorkspacePresetFromList(store, workspaceId) : undefined;
|
|
8428
8420
|
});
|
|
8429
8421
|
var workspaceCreator = (currentWorkspacePreset == null ? void 0 : currentWorkspacePreset.username) || '';
|
|
8430
8422
|
var viewIds = useSelector(function (store) {
|
|
8431
8423
|
return getViewIds(store);
|
|
8432
8424
|
});
|
|
8433
|
-
var isNew = workspaceId
|
|
8434
|
-
var fullTitle = getPresetTitle(title, hasChanges, isNew, t);
|
|
8425
|
+
var isNew = !workspaceId;
|
|
8435
8426
|
var isUserPreset = workspaceScope === 'user';
|
|
8436
8427
|
var isUserPresetCreator = (auth == null ? void 0 : auth.username) === workspaceCreator;
|
|
8437
|
-
React.useEffect(function () {
|
|
8438
|
-
setDocumentTitle(fullTitle, appTitle);
|
|
8439
|
-
}, [fullTitle, appTitle]);
|
|
8440
8428
|
var setWorkspaceActionDialogOptions = React.useCallback(function (dialogOptions) {
|
|
8441
8429
|
dispatch(workspaceListActions.openWorkspaceActionDialogOptions(dialogOptions));
|
|
8442
8430
|
}, [dispatch]);
|
|
@@ -8541,15 +8529,98 @@ var WorkspaceOptionsConnect = function WorkspaceOptionsConnect(_ref) {
|
|
|
8541
8529
|
return isUserPreset && isUserPresetCreator ? onEdit : undefined;
|
|
8542
8530
|
};
|
|
8543
8531
|
return jsx(WorkspaceOptions, {
|
|
8544
|
-
|
|
8545
|
-
title: fullTitle,
|
|
8546
|
-
activeTab: activeTab,
|
|
8547
|
-
handleDelete: getOnDelete(),
|
|
8548
|
-
handleSaveAs: handleSaveAs(),
|
|
8532
|
+
isDisabled: !viewIds.length || !isLoggedIn,
|
|
8549
8533
|
handleSave: handleSave(),
|
|
8534
|
+
handleSaveAs: handleSaveAs(),
|
|
8550
8535
|
handleEdit: handleEdit(),
|
|
8551
|
-
|
|
8552
|
-
|
|
8536
|
+
handleDelete: getOnDelete(),
|
|
8537
|
+
handleReset: onReset
|
|
8538
|
+
});
|
|
8539
|
+
};
|
|
8540
|
+
|
|
8541
|
+
/* *
|
|
8542
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8543
|
+
* you may not use this file except in compliance with the License.
|
|
8544
|
+
* You may obtain a copy of the License at
|
|
8545
|
+
*
|
|
8546
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8547
|
+
*
|
|
8548
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8549
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8550
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8551
|
+
* See the License for the specific language governing permissions and
|
|
8552
|
+
* limitations under the License.
|
|
8553
|
+
*
|
|
8554
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8555
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
8556
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
8557
|
+
* */
|
|
8558
|
+
var useFetchWorkspacePresets = function useFetchWorkspacePresets() {
|
|
8559
|
+
var dispatch = useDispatch();
|
|
8560
|
+
var _useAuthenticationCon = useAuthenticationContext(),
|
|
8561
|
+
currentRole = _useAuthenticationCon.currentRole;
|
|
8562
|
+
var isAdmin = (currentRole == null ? void 0 : currentRole.name) === GEOWEB_ROLE_PRESETS_ADMIN.name;
|
|
8563
|
+
var lastAdmin = usePrevious(isAdmin);
|
|
8564
|
+
var workspaceSearchQuery = useSelector(getWorkspaceListSearchQuery);
|
|
8565
|
+
var prevSearch = usePrevious(workspaceSearchQuery);
|
|
8566
|
+
var fetchWorkspacePresets = useCallback(function (params) {
|
|
8567
|
+
dispatch(workspaceListActions.fetchWorkspaceList(params));
|
|
8568
|
+
}, [dispatch]);
|
|
8569
|
+
useEffect(function () {
|
|
8570
|
+
if (workspaceSearchQuery !== prevSearch) {
|
|
8571
|
+
var filterParams = constructFilterParams([], workspaceSearchQuery);
|
|
8572
|
+
fetchWorkspacePresets(filterParams);
|
|
8573
|
+
}
|
|
8574
|
+
}, [fetchWorkspacePresets, prevSearch, workspaceSearchQuery]);
|
|
8575
|
+
useEffect(function () {
|
|
8576
|
+
if (isAdmin !== lastAdmin && lastAdmin !== undefined) {
|
|
8577
|
+
// reset list filter when user changes role
|
|
8578
|
+
var filters = [{
|
|
8579
|
+
id: PresetFilterType.system,
|
|
8580
|
+
isSelected: true
|
|
8581
|
+
}, {
|
|
8582
|
+
id: PresetFilterType.personal,
|
|
8583
|
+
isSelected: !isAdmin
|
|
8584
|
+
}, {
|
|
8585
|
+
id: PresetFilterType.shared,
|
|
8586
|
+
isSelected: true
|
|
8587
|
+
}];
|
|
8588
|
+
dispatch(workspaceListActions.setFilterChips(filters));
|
|
8589
|
+
}
|
|
8590
|
+
}, [dispatch, isAdmin, lastAdmin]);
|
|
8591
|
+
};
|
|
8592
|
+
|
|
8593
|
+
var WorkspaceMenuButtonConnect = function WorkspaceMenuButtonConnect(_ref) {
|
|
8594
|
+
var title = _ref.title,
|
|
8595
|
+
workspaceId = _ref.workspaceId,
|
|
8596
|
+
activeTab = _ref.activeTab,
|
|
8597
|
+
appTitle = _ref.appTitle;
|
|
8598
|
+
var dispatch = useDispatch();
|
|
8599
|
+
var _useWorkspaceTranslat = useWorkspaceTranslation(),
|
|
8600
|
+
t = _useWorkspaceTranslat.t;
|
|
8601
|
+
var hasChanges = useSelector(function (store) {
|
|
8602
|
+
return hasWorkspaceChanges(store);
|
|
8603
|
+
});
|
|
8604
|
+
var isWorkspaceListDialogOpen = useSelector(function (store) {
|
|
8605
|
+
return getIsWorkspaceListDialogOpen(store);
|
|
8606
|
+
});
|
|
8607
|
+
var setListDialogOpen = React.useCallback(function (isListDialogOpen) {
|
|
8608
|
+
dispatch(workspaceListActions.toggleWorkspaceDialog({
|
|
8609
|
+
isWorkspaceListDialogOpen: isListDialogOpen
|
|
8610
|
+
}));
|
|
8611
|
+
}, [dispatch]);
|
|
8612
|
+
useFetchWorkspacePresets();
|
|
8613
|
+
var isNew = workspaceId === undefined || workspaceId === '';
|
|
8614
|
+
var fullTitle = getPresetTitle(title, hasChanges, isNew, t);
|
|
8615
|
+
React.useEffect(function () {
|
|
8616
|
+
setDocumentTitle(fullTitle, appTitle);
|
|
8617
|
+
}, [fullTitle, appTitle]);
|
|
8618
|
+
return jsx(WorkspaceMenuButton, {
|
|
8619
|
+
title: fullTitle,
|
|
8620
|
+
activeTab: activeTab,
|
|
8621
|
+
hasChanges: hasChanges,
|
|
8622
|
+
showMenu: isWorkspaceListDialogOpen,
|
|
8623
|
+
onToggleDialog: setListDialogOpen
|
|
8553
8624
|
});
|
|
8554
8625
|
};
|
|
8555
8626
|
|
|
@@ -8565,11 +8636,14 @@ var WorkspaceTab = function WorkspaceTab(_ref) {
|
|
|
8565
8636
|
alignItems: 'center'
|
|
8566
8637
|
},
|
|
8567
8638
|
"data-testid": "workspaceTab",
|
|
8568
|
-
children: [jsx(WorkspaceMenuButtonConnect, {
|
|
8639
|
+
children: [jsx(WorkspaceMenuButtonConnect, {
|
|
8569
8640
|
title: title,
|
|
8570
|
-
activeTab: activeTab,
|
|
8571
8641
|
workspaceId: workspaceId,
|
|
8642
|
+
activeTab: activeTab,
|
|
8572
8643
|
appTitle: appTitle
|
|
8644
|
+
}), jsx(WorkspaceOptionsConnect, {
|
|
8645
|
+
title: title,
|
|
8646
|
+
workspaceId: workspaceId
|
|
8573
8647
|
})]
|
|
8574
8648
|
});
|
|
8575
8649
|
};
|