@opengeoweb/workspace 9.25.3 → 9.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -3,19 +3,19 @@ import _, { chunk, cloneDeep, isEmpty, isEqual, isString } from 'lodash';
3
3
  import { syncGroupsTypes, syncGroupsActions, layerActions, mapStoreActions, uiActions, genericActions, mapActions, layerTypes, mapEnums, selectorMemoizationOptions, genericSelectors, mapSelectors, syncGroupsSelectors, routerActions, coreModuleConfig, loadingIndicatorSelectors, uiSelectors } from '@opengeoweb/store';
4
4
  import { createApiInstance, createNonAuthApiInstance, getApi, createFakeApiInstance, ApiProvider, useApiContext } from '@opengeoweb/api';
5
5
  import { getLeaves, MosaicContext, getAndAssertNodeAtPathExists, createBalancedTreeFromLeaves, MosaicWindow, Mosaic } from 'react-mosaic-component';
6
+ import { SHARED_NAMESPACE, sharedTranslations, PROJECTION, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, DEFAULT_FILTER_HEIGHT, usePrevious, Filter, Resizable, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
6
7
  import i18n from 'i18next';
7
- import { SHARED_NAMESPACE, sharedTranslations, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, DEFAULT_FILTER_HEIGHT, usePrevious, Filter, Resizable, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
8
8
  import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations } from '@opengeoweb/webmap-react';
9
9
  import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
10
10
  import { CORE_NAMESPACE, coreTranslations } from '@opengeoweb/core';
11
11
  import { FORM_FIELDS_NAMESPACE, formFieldsTranslations, ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
12
+ import { timeSeriesSelectors, timeSeriesModuleConfig } from '@opengeoweb/timeseries';
12
13
  import { takeLatest, takeEvery, debounce, delay, put, all, select, call as call$g, takeLeading } from 'redux-saga/effects';
13
14
  import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
14
15
  import { isAxiosError as isAxiosError$1 } from 'axios';
15
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
17
  import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, CloudLoading, CloudIdle, WebAssetOff } from '@opengeoweb/theme';
17
18
  import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
18
- import { timeSeriesModuleConfig } from '@opengeoweb/timeseries';
19
19
  import { AuthenticationProvider, useAuthenticationContext } from '@opengeoweb/authentication';
20
20
  import { createStore } from '@redux-eggs/redux-toolkit';
21
21
  import { getSagaExtension } from '@redux-eggs/saga-extension';
@@ -3630,7 +3630,7 @@ const emptyMapWorkspace = Object.assign(Object.assign({}, getEmptyWorkspaceListI
3630
3630
  right: 3967387.5161,
3631
3631
  top: 11520588.9031
3632
3632
  },
3633
- srs: 'EPSG:3857'
3633
+ srs: PROJECTION.EPSG_3857.value
3634
3634
  },
3635
3635
  shouldShowLayerManager: true,
3636
3636
  dockedLayerManagerSize: 'sizeSmall'
@@ -3662,7 +3662,7 @@ const getEmptyWorkspacePreset = () => ({
3662
3662
  right: 3967387.5161,
3663
3663
  top: 11520588.9031
3664
3664
  },
3665
- srs: 'EPSG:3857'
3665
+ srs: PROJECTION.EPSG_3857.value
3666
3666
  },
3667
3667
  shouldShowLayerManager: true,
3668
3668
  dockedLayerManagerSize: 'sizeSmall'
@@ -4051,14 +4051,34 @@ const getSnackbarMessage = (action, title) => {
4051
4051
  });
4052
4052
  }
4053
4053
  };
4054
- const emptyMapViewPreset = {
4055
- componentType: 'Map',
4056
- keywords: '',
4057
- scope: 'user',
4058
- title: '',
4059
- initialProps: {
4060
- mapPreset: {}
4061
- }
4054
+ const emptyViewPreset = (componentType = 'Map') => {
4055
+ const actualComponentType = componentType || 'Map';
4056
+ const initialPropsByType = {
4057
+ Map: {
4058
+ mapPreset: {}
4059
+ },
4060
+ TimeSeries: {
4061
+ plotPreset: {
4062
+ mapId: '',
4063
+ plots: [],
4064
+ parameters: []
4065
+ },
4066
+ services: []
4067
+ },
4068
+ ViewError: undefined,
4069
+ ViewLoading: undefined,
4070
+ MultiMap: undefined,
4071
+ ModelRunInterval: undefined,
4072
+ HarmonieTempAndPrecipPreset: undefined,
4073
+ TimeSlider: undefined
4074
+ };
4075
+ return {
4076
+ componentType: actualComponentType,
4077
+ keywords: '',
4078
+ scope: 'user',
4079
+ title: '',
4080
+ initialProps: initialPropsByType[actualComponentType]
4081
+ };
4062
4082
  };
4063
4083
  // Returns object of applied user filters such as scope/search etc
4064
4084
  // If all filter chips are selected, an empty string is returned for that filter which is interpreted in the BE as "return all" _
@@ -4196,17 +4216,23 @@ const getWorkspaceData = createSelector(getWorkspaceState, getViewPresetsStore,
4196
4216
  mosaicNode: store.mosaicNode
4197
4217
  };
4198
4218
  }, selectorMemoizationOptions);
4199
- const getViewPresetToSendToBackend = createSelector(getViewById, mapSelectors.getMapPreset, syncGroupsSelectors.getAllTargetGroupsForSource, (workspaceView, mapPreset, syncGroupsIds) => {
4219
+ const getViewComponentType = createSelector(getViewById, store => (store === null || store === void 0 ? void 0 : store.componentType) || 'Map', selectorMemoizationOptions);
4220
+ const getViewPresetToSendToBackend = createSelector(getViewById, getViewComponentType, mapSelectors.getMapPreset, syncGroupsSelectors.getAllTargetGroupsForSource, timeSeriesSelectors.getTimeSeriesPreset, (workspaceView, viewComponentType, mapPreset, syncGroupsIds, timeSeriesPreset) => {
4200
4221
  const title = (workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.title) || translateKeyOutsideComponents('workspace-mappreset-new');
4201
4222
  const scope = (workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.scope) || 'system';
4202
- return Object.assign(Object.assign({}, emptyMapViewPreset), {
4223
+ const defaultInitialProps = {
4224
+ mapPreset,
4225
+ syncGroupsIds
4226
+ };
4227
+ const initialPropsByComponentType = {
4228
+ Map: defaultInitialProps,
4229
+ TimeSeries: timeSeriesPreset
4230
+ };
4231
+ return Object.assign(Object.assign({}, emptyViewPreset(viewComponentType)), {
4203
4232
  id: workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.id,
4204
4233
  scope,
4205
4234
  title,
4206
- initialProps: {
4207
- mapPreset,
4208
- syncGroupsIds
4209
- }
4235
+ initialProps: initialPropsByComponentType[viewComponentType] || defaultInitialProps
4210
4236
  });
4211
4237
  }, selectorMemoizationOptions);
4212
4238
 
@@ -4218,6 +4244,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
4218
4244
  getSelectedWorkspaceTitle: getSelectedWorkspaceTitle,
4219
4245
  getShouldPreventClose: getShouldPreventClose,
4220
4246
  getViewById: getViewById,
4247
+ getViewComponentType: getViewComponentType,
4221
4248
  getViewIds: getViewIds,
4222
4249
  getViewPresetToSendToBackend: getViewPresetToSendToBackend,
4223
4250
  getViewType: getViewType,
@@ -7690,17 +7717,17 @@ viewPresetsListener.startListening({
7690
7717
  // new map preset selected
7691
7718
  listenerApi.dispatch(mapStoreActions.setMapPreset({
7692
7719
  mapId: panelId,
7693
- initialProps: emptyMapViewPreset.initialProps
7720
+ initialProps: emptyViewPreset('Map').initialProps
7694
7721
  }));
7695
7722
  // update workspace with new empy view map
7696
7723
  listenerApi.dispatch(workspaceActions.updateWorkspaceView({
7697
- viewPreset: emptyMapViewPreset,
7724
+ viewPreset: emptyViewPreset('Map'),
7698
7725
  mosaicNodeId: panelId
7699
7726
  }));
7700
7727
  listenerApi.dispatch(viewPresetActions.fetchedViewPreset({
7701
7728
  panelId,
7702
7729
  viewPresetId,
7703
- viewPreset: emptyMapViewPreset
7730
+ viewPreset: emptyViewPreset('Map')
7704
7731
  }));
7705
7732
  }
7706
7733
  })
@@ -8525,7 +8552,9 @@ const ViewPresetMenuListConnect = ({
8525
8552
  } = useWorkspaceTranslation();
8526
8553
  const viewPresets = useSelector(store => getFilteredViewPresetListForView(store, panelId));
8527
8554
  const activeViewPresetId = useSelector(store => getViewPresetActiveId(store, panelId));
8555
+ const viewComponentType = useSelector(store => getViewComponentType(store, panelId));
8528
8556
  const currentMapPreset = useSelector(store => mapSelectors.getMapPreset(store, panelId));
8557
+ const currentTimeSeriesPreset = useSelector(store => timeSeriesSelectors.getTimeSeriesPreset(store));
8529
8558
  const viewPresetListFilters = useSelector(store => getViewPresetListFiltersForView(store, panelId));
8530
8559
  const lastViewPresetListFilters = usePrevious(viewPresetListFilters);
8531
8560
  const viewPresetListSearchQuery = useSelector(store => getViewPresetListSearchQueryForView(store, panelId));
@@ -8564,6 +8593,19 @@ const ViewPresetMenuListConnect = ({
8564
8593
  filterParams
8565
8594
  }));
8566
8595
  }, [dispatch, panelId, viewPresetListFilters, viewPresetListSearchQuery]);
8596
+ const constructInitialProps = () => {
8597
+ switch (viewComponentType) {
8598
+ case 'TimeSeries':
8599
+ return currentTimeSeriesPreset;
8600
+ case 'Map':
8601
+ return {
8602
+ mapPreset: currentMapPreset,
8603
+ syncGroupsIds: relatedSyncGroupIds
8604
+ };
8605
+ default:
8606
+ return undefined;
8607
+ }
8608
+ };
8567
8609
  const onClickViewPresetOption = (presetId, workspaceAction, preset) => {
8568
8610
  switch (workspaceAction) {
8569
8611
  case WorkspacePresetAction.DUPLICATE:
@@ -8575,10 +8617,7 @@ const ViewPresetMenuListConnect = ({
8575
8617
  panelId,
8576
8618
  formValues: {
8577
8619
  title: preset.title,
8578
- initialProps: {
8579
- mapPreset: currentMapPreset,
8580
- syncGroupsIds: relatedSyncGroupIds
8581
- }
8620
+ initialProps: constructInitialProps()
8582
8621
  }
8583
8622
  });
8584
8623
  break;
@@ -8973,8 +9012,9 @@ const WorkspaceViewTitleConnectNoMemo = ({
8973
9012
  scope
8974
9013
  };
8975
9014
  }, shallowEqual);
8976
- const hasMapPresetChanges = useSelector(store => getViewPresetHasChanges(store, panelId));
8977
- const activeMapPresetId = useSelector(store => getViewPresetActiveId(store, panelId));
9015
+ const viewComponentType = useSelector(store => getViewComponentType(store, panelId));
9016
+ const hasViewPresetChanges = useSelector(store => getViewPresetHasChanges(store, panelId));
9017
+ const activeViewPresetId = useSelector(store => getViewPresetActiveId(store, panelId));
8978
9018
  const relatedSyncGroupIds = useSelector(store => syncGroupsSelectors.getAllTargetGroupsForSource(store, panelId));
8979
9019
  const getPresetTitle = (title, hasChanges, isNew) => {
8980
9020
  if (!hasChanges) {
@@ -8983,71 +9023,75 @@ const WorkspaceViewTitleConnectNoMemo = ({
8983
9023
  const suffix = isNew ? t('workspace-modified-existing') : t('workspace-modified-new');
8984
9024
  return `${title} (${suffix})`;
8985
9025
  };
8986
- const isNewActive = activeMapPresetId === '';
9026
+ const isNewActive = activeViewPresetId === '';
8987
9027
  const title = workspaceView.title || t('workspace-mappreset-new');
8988
9028
  const viewScope = workspaceView.scope;
8989
- const fullTitle = getPresetTitle(title, hasMapPresetChanges, isNewActive);
9029
+ const fullTitle = getPresetTitle(title, hasViewPresetChanges, isNewActive);
8990
9030
  const openViewPresetsDialog = React.useCallback(viewPresetDialogOptions => {
8991
9031
  dispatch(viewPresetActions.openViewPresetDialog({
8992
9032
  viewPresetDialog: viewPresetDialogOptions
8993
9033
  }));
8994
9034
  }, [dispatch]);
9035
+ const constructInitialProps = React.useCallback(() => {
9036
+ switch (viewComponentType) {
9037
+ case 'TimeSeries':
9038
+ return timeSeriesSelectors.getTimeSeriesPreset(store.getState());
9039
+ case 'Map':
9040
+ return {
9041
+ mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
9042
+ syncGroupsIds: relatedSyncGroupIds
9043
+ };
9044
+ default:
9045
+ return undefined;
9046
+ }
9047
+ }, [panelId, relatedSyncGroupIds, store, viewComponentType]);
8995
9048
  const onSave = React.useCallback(() => {
8996
9049
  dispatch(viewPresetActions.saveViewPreset({
8997
9050
  panelId,
8998
- viewPresetId: activeMapPresetId,
8999
- viewPreset: Object.assign(Object.assign({}, emptyMapViewPreset), {
9051
+ viewPresetId: activeViewPresetId,
9052
+ viewPreset: Object.assign(Object.assign({}, emptyViewPreset(viewComponentType)), {
9000
9053
  title,
9001
- initialProps: {
9002
- mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
9003
- syncGroupsIds: relatedSyncGroupIds
9004
- }
9054
+ initialProps: constructInitialProps()
9005
9055
  })
9006
9056
  }));
9007
- }, [activeMapPresetId, dispatch, panelId, relatedSyncGroupIds, store, title]);
9057
+ }, [activeViewPresetId, constructInitialProps, dispatch, panelId, title, viewComponentType]);
9008
9058
  const onDelete = React.useCallback(() => {
9009
9059
  openViewPresetsDialog({
9010
9060
  title: t('workspace-mappreset-dialog-title-delete'),
9011
9061
  action: PresetAction.DELETE,
9012
- viewPresetId: activeMapPresetId,
9062
+ viewPresetId: activeViewPresetId,
9013
9063
  panelId,
9014
9064
  formValues: {
9015
9065
  title
9016
9066
  }
9017
9067
  });
9018
- }, [activeMapPresetId, openViewPresetsDialog, panelId, title, t]);
9068
+ }, [activeViewPresetId, openViewPresetsDialog, panelId, title, t]);
9019
9069
  const onSaveAs = React.useCallback(() => {
9020
- const formTitle = activeMapPresetId ? title : '';
9070
+ const formTitle = activeViewPresetId ? title : '';
9021
9071
  openViewPresetsDialog({
9022
9072
  title: t('workspace-mappreset-save-as'),
9023
9073
  action: PresetAction.SAVE_AS,
9024
- viewPresetId: activeMapPresetId,
9074
+ viewPresetId: activeViewPresetId,
9025
9075
  panelId,
9026
9076
  formValues: {
9027
9077
  title: formTitle,
9028
- initialProps: {
9029
- mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
9030
- syncGroupsIds: relatedSyncGroupIds
9031
- }
9078
+ initialProps: constructInitialProps()
9032
9079
  }
9033
9080
  });
9034
- }, [activeMapPresetId, openViewPresetsDialog, panelId, relatedSyncGroupIds, store, title, t]);
9081
+ }, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title]);
9035
9082
  const onEdit = React.useCallback(() => {
9036
- const formTitle = activeMapPresetId ? title : '';
9083
+ const formTitle = activeViewPresetId ? title : '';
9037
9084
  openViewPresetsDialog({
9038
9085
  title: t('workspace-mappreset-dialog-title-edit'),
9039
9086
  action: PresetAction.EDIT,
9040
9087
  panelId,
9041
- viewPresetId: activeMapPresetId,
9088
+ viewPresetId: activeViewPresetId,
9042
9089
  formValues: {
9043
9090
  title: formTitle,
9044
- initialProps: {
9045
- mapPreset: mapSelectors.getMapPreset(store.getState(), panelId),
9046
- syncGroupsIds: relatedSyncGroupIds
9047
- }
9091
+ initialProps: constructInitialProps()
9048
9092
  }
9049
9093
  });
9050
- }, [activeMapPresetId, openViewPresetsDialog, panelId, relatedSyncGroupIds, store, title, t]);
9094
+ }, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title]);
9051
9095
  const toggleViewPresetDialog = React.useCallback(({
9052
9096
  panelId,
9053
9097
  isViewPresetDialogOpen
@@ -9079,7 +9123,7 @@ const WorkspaceViewTitleConnectNoMemo = ({
9079
9123
  })), jsx(WorkspaceOptions, {
9080
9124
  panelId: panelId,
9081
9125
  title: fullTitle,
9082
- hasChanges: hasMapPresetChanges || isNewActive,
9126
+ hasChanges: hasViewPresetChanges || isNewActive,
9083
9127
  handleSave: viewScope === 'user' ? onSave : undefined,
9084
9128
  handleDelete: viewScope === 'user' ? onDelete : undefined,
9085
9129
  handleSaveAs: onSaveAs,
@@ -10061,6 +10105,7 @@ const validateTitle = value => {
10061
10105
  return !value.trim().length ? 'This field is required' : true;
10062
10106
  };
10063
10107
  const MapPresetsForm = ({
10108
+ viewComponentType,
10064
10109
  error,
10065
10110
  onSubmit,
10066
10111
  action,
@@ -10070,7 +10115,7 @@ const MapPresetsForm = ({
10070
10115
  const {
10071
10116
  t
10072
10117
  } = useWorkspaceTranslation();
10073
- const _a = Object.assign(Object.assign({}, emptyMapViewPreset), formValues),
10118
+ const _a = Object.assign(Object.assign({}, emptyViewPreset(viewComponentType)), formValues),
10074
10119
  {
10075
10120
  title
10076
10121
  } = _a,
@@ -10138,6 +10183,7 @@ const MapPresetsFormDialog = ({
10138
10183
  isOpen,
10139
10184
  action,
10140
10185
  viewPresetId,
10186
+ viewComponentType,
10141
10187
  formValues,
10142
10188
  onSuccess,
10143
10189
  onClose,
@@ -10249,6 +10295,7 @@ const MapPresetsFormDialog = ({
10249
10295
  onSubmit: onSubmit,
10250
10296
  isLoading: isLoading,
10251
10297
  content: jsx(MapPresetsForm, {
10298
+ viewComponentType: viewComponentType,
10252
10299
  formValues: formValues,
10253
10300
  error: error,
10254
10301
  onSubmit: onSubmit,
@@ -10268,6 +10315,8 @@ const MapPresetsFormDialogWrapper = _a => {
10268
10315
  const MapPresetsFormDialogConnect = () => {
10269
10316
  const dispatch = useDispatch();
10270
10317
  const dialogOptions = useSelector(store => getDialogOptions(store));
10318
+ const panelId = dialogOptions === null || dialogOptions === void 0 ? void 0 : dialogOptions.panelId;
10319
+ const viewComponentType = useSelector(store => getViewComponentType(store, panelId));
10271
10320
  const closeDialog = React__default.useCallback(() => {
10272
10321
  dispatch(viewPresetActions.closeViewPresetDialog());
10273
10322
  }, [dispatch]);
@@ -10276,7 +10325,7 @@ const MapPresetsFormDialogConnect = () => {
10276
10325
  };
10277
10326
  const onSuccess = (action, newViewPresetId, title) => {
10278
10327
  dispatch(viewPresetActions.onSuccessViewPresetAction({
10279
- panelId: dialogOptions === null || dialogOptions === void 0 ? void 0 : dialogOptions.panelId,
10328
+ panelId,
10280
10329
  viewPresetId: newViewPresetId,
10281
10330
  action,
10282
10331
  title
@@ -10289,7 +10338,8 @@ const MapPresetsFormDialogConnect = () => {
10289
10338
  return jsx(MapPresetsFormDialogWrapper, Object.assign({
10290
10339
  isOpen: isOpen,
10291
10340
  onClose: onClose,
10292
- onSuccess: onSuccess
10341
+ onSuccess: onSuccess,
10342
+ viewComponentType: viewComponentType
10293
10343
  }, dialogOptions, {
10294
10344
  formValues: dialogOptions === null || dialogOptions === void 0 ? void 0 : dialogOptions.formValues
10295
10345
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/workspace",
3
- "version": "9.25.3",
3
+ "version": "9.26.0",
4
4
  "description": "GeoWeb Workspace library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "i18next": "^23.11.5",
37
37
  "react-i18next": "^14.1.2",
38
38
  "@mui/material": "^5.16.0",
39
- "@opengeoweb/webmap-react": "9.25.3"
39
+ "@opengeoweb/webmap-react": "9.26.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": "18"
@@ -1,18 +1,16 @@
1
- import { mapTypes } from '@opengeoweb/store';
2
1
  import React from 'react';
3
- import { PresetAction } from '../../store/viewPresets/types';
4
- export interface MapPresetFormValues {
2
+ import { InitialProps } from '@opengeoweb/core';
3
+ import { PresetAction, WorkspaceSupportedComponentTypes } from '../../store/viewPresets/types';
4
+ export interface ViewPresetFormValues {
5
5
  title?: string;
6
- initialProps?: {
7
- mapPreset: mapTypes.MapPreset;
8
- syncGroupsIds?: string[];
9
- };
6
+ initialProps?: InitialProps;
10
7
  }
11
- interface MapPresetsFormProps {
8
+ export interface MapPresetsFormProps {
9
+ viewComponentType: WorkspaceSupportedComponentTypes;
12
10
  error?: string;
13
11
  onSubmit?: () => void;
14
12
  action: PresetAction;
15
- formValues: MapPresetFormValues;
13
+ formValues: ViewPresetFormValues;
16
14
  }
17
15
  declare const MapPresetsForm: React.FC<MapPresetsFormProps>;
18
16
  export default MapPresetsForm;
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
- import { MapPresetFormValues } from './MapPresetsForm';
3
- import { PresetAction } from '../../store/viewPresets/types';
2
+ import { ViewPresetFormValues } from './MapPresetsForm';
3
+ import { PresetAction, WorkspaceSupportedComponentTypes } from '../../store/viewPresets/types';
4
4
  export interface MapPresetsFormDialogProps {
5
5
  isOpen: boolean;
6
6
  title: string;
7
7
  action: PresetAction;
8
8
  viewPresetId: string;
9
- formValues: MapPresetFormValues;
9
+ viewComponentType: WorkspaceSupportedComponentTypes;
10
+ formValues: ViewPresetFormValues;
10
11
  onSuccess: (action: PresetAction, presetId: string, title: string) => void;
11
12
  onClose: () => void;
12
13
  }
@@ -1,12 +1,14 @@
1
1
  import { InitialProps, SupportedComponentTypes } from '@opengeoweb/core';
2
+ import { SupportedComponentTypes as SupportedTimeSeriesComponentTypes } from '@opengeoweb/timeseries';
2
3
  import { EntityState } from '@reduxjs/toolkit';
3
4
  import { FetchViewPresetsListParams, PresetScope, ViewPresetListItem } from '../viewPresetsList/types';
4
5
  import { WorkspaceViewPresetComponentsLookupType } from '../workspace/types';
6
+ export type WorkspaceSupportedComponentTypes = SupportedComponentTypes | SupportedTimeSeriesComponentTypes | WorkspaceViewPresetComponentsLookupType;
5
7
  export interface ViewPreset {
6
8
  id?: string;
7
9
  title: string;
8
10
  keywords: string;
9
- componentType: SupportedComponentTypes | WorkspaceViewPresetComponentsLookupType;
11
+ componentType: WorkspaceSupportedComponentTypes;
10
12
  initialProps?: InitialProps;
11
13
  scope?: PresetScope;
12
14
  }
@@ -1,15 +1,7 @@
1
1
  import { PresetsApi } from '../../utils/api';
2
- import { PresetAction, ViewPresetsListFilter } from './types';
2
+ import { PresetAction, ViewPreset, ViewPresetsListFilter, WorkspaceSupportedComponentTypes } from './types';
3
3
  import { FetchViewPresetsListParams } from '../viewPresetsList/types';
4
4
  export declare const getSnackbarMessage: (action: PresetAction, title: string) => string;
5
5
  export declare const getPresetsApi: () => PresetsApi;
6
- export declare const emptyMapViewPreset: {
7
- componentType: "Map";
8
- keywords: string;
9
- scope: "user";
10
- title: string;
11
- initialProps: {
12
- mapPreset: {};
13
- };
14
- };
6
+ export declare const emptyViewPreset: (componentType?: WorkspaceSupportedComponentTypes | undefined) => ViewPreset;
15
7
  export declare const constructFilterParams: (filters: ViewPresetsListFilter[], searchQuery: string) => FetchViewPresetsListParams;
@@ -1,5 +1,7 @@
1
+ import { InitialProps } from '@opengeoweb/core';
1
2
  import { WorkspaceState } from './types';
2
3
  import { AppStore } from '../types';
4
+ import { WorkspaceSupportedComponentTypes } from '../viewPresets/types';
3
5
  /**
4
6
  * Gets workspace state
5
7
  *
@@ -157,26 +159,25 @@ export declare const getWorkspaceData: ((state: AppStore & import("@opengeoweb/s
157
159
  }> & {
158
160
  clearCache: () => void;
159
161
  };
162
+ export declare const getViewComponentType: ((state: AppStore, viewId: string) => WorkspaceSupportedComponentTypes) & import("reselect").OutputSelectorFields<(args_0: import("./types").WorkspaceViewType | undefined) => WorkspaceSupportedComponentTypes, {
163
+ clearCache: () => void;
164
+ }> & {
165
+ clearCache: () => void;
166
+ };
160
167
  export declare const getViewPresetToSendToBackend: ((state: any, viewId: any) => {
161
168
  id: string | undefined;
162
169
  scope: import("./types").PresetScope;
163
170
  title: string;
164
- initialProps: {
165
- mapPreset: import("@opengeoweb/store").MapPreset;
166
- syncGroupsIds: string[];
167
- };
168
- componentType: "Map";
171
+ initialProps: InitialProps;
169
172
  keywords: string;
170
- }) & import("reselect").OutputSelectorFields<(args_0: import("./types").WorkspaceViewType | undefined, args_1: import("@opengeoweb/store").MapPreset, args_2: string[]) => {
173
+ componentType: WorkspaceSupportedComponentTypes;
174
+ }) & import("reselect").OutputSelectorFields<(args_0: import("./types").WorkspaceViewType | undefined, args_1: WorkspaceSupportedComponentTypes, args_2: import("@opengeoweb/store").MapPreset, args_3: string[], args_4: import("dist/libs/timeseries/src/lib/store/types").TimeSeriesPreset | undefined) => {
171
175
  id: string | undefined;
172
176
  scope: import("./types").PresetScope;
173
177
  title: string;
174
- initialProps: {
175
- mapPreset: import("@opengeoweb/store").MapPreset;
176
- syncGroupsIds: string[];
177
- };
178
- componentType: "Map";
178
+ initialProps: InitialProps;
179
179
  keywords: string;
180
+ componentType: WorkspaceSupportedComponentTypes;
180
181
  }, {
181
182
  clearCache: () => void;
182
183
  }> & {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { MapPreset, syncGroupsTypes } from '@opengeoweb/store';
3
3
  import { MosaicNode } from 'react-mosaic-component';
4
- type InitialPropsWorkspaceViewType = Record<string, unknown>;
4
+ export type InitialPropsWorkspaceViewType = Record<string, unknown>;
5
5
  export type WorkspaceViewPresetComponentsLookupType = 'ViewError' | 'ViewLoading';
6
6
  export interface WorkspaceViewType {
7
7
  id?: string;
@@ -142,4 +142,3 @@ export interface WorkspaceErrorWorkspacePayload {
142
142
  workspaceId: string;
143
143
  error: WorkspaceError;
144
144
  }
145
- export {};