@opengeoweb/workspace 9.29.1 → 9.31.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 +4437 -4406
- package/package.json +2 -2
- package/src/index.d.ts +3 -1
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectList.d.ts +1 -1
- package/src/lib/components/WorkspaceSelectList/WorkspaceSelectListRow.d.ts +1 -1
- package/src/lib/components/WorkspaceView/helpers.d.ts +1 -0
- package/src/lib/store/workspace/listener.d.ts +2 -2
- package/src/lib/store/workspace/reducer.d.ts +2 -3
- package/src/lib/store/workspace/selectors.d.ts +3 -3
- package/src/lib/store/workspace/types.d.ts +5 -5
- package/src/lib/store/workspaceList/listener.d.ts +1 -1
- package/src/lib/store/workspaceList/types.d.ts +13 -2
- package/src/lib/store/workspaceList/utils.d.ts +8 -4
- package/src/lib/utils/i18n.d.ts +2 -2
- package/src/lib/utils/testUtils.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/workspace",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.31.0",
|
|
4
4
|
"description": "GeoWeb Workspace library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@redux-eggs/core": "^2.2.0",
|
|
22
22
|
"@redux-eggs/redux-toolkit": "^2.2.0",
|
|
23
23
|
"immer": "^10.0.3",
|
|
24
|
-
"axios": "1.
|
|
24
|
+
"axios": "^1.7.7",
|
|
25
25
|
"react-virtualized-auto-sizer": "^1.0.21",
|
|
26
26
|
"react-mosaic-component": "^6.1.0",
|
|
27
27
|
"@opengeoweb/form-fields": "*",
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import workspaceTranslations from '../locales/workspace.json';
|
|
2
|
+
import { workspaceListener } from './lib/store/workspace/listener';
|
|
3
|
+
export { workspaceListener };
|
|
2
4
|
export { workspaceActions as actions, reducer as workspaceReducer, } from './lib/store/workspace/reducer';
|
|
3
5
|
export { workspaceListActions } from './lib/store/workspaceList/reducer';
|
|
4
6
|
export { viewPresetActions } from './lib/store/viewPresets';
|
|
@@ -13,5 +15,5 @@ export * from './lib/components/WorkspaceDetail';
|
|
|
13
15
|
export { WORKSPACE_NAMESPACE } from './lib/utils/i18n';
|
|
14
16
|
export { workspaceTranslations };
|
|
15
17
|
export { routes as workspaceRoutes, getWorkspaceRouteUrl, } from './lib/utils/routes';
|
|
16
|
-
export {
|
|
18
|
+
export { getEmptyMapWorkspace, createCustomEmptyMapWorkspace, } from './lib/store/workspaceList/utils';
|
|
17
19
|
export type { WorkspaceModuleStore } from './lib/store/types';
|
|
@@ -4,7 +4,7 @@ import { WorkspacePresetListItem, WorkspacePresetAction } from '../../store/work
|
|
|
4
4
|
export interface WorkspaceSelectListProps extends BoxProps {
|
|
5
5
|
workspacePresets: WorkspacePresetListItem[];
|
|
6
6
|
currentSelectedId: string;
|
|
7
|
-
|
|
7
|
+
onClickWorkspacePreset: (id: string) => void;
|
|
8
8
|
onClickWorkspacePresetOption: (presetId: string, workspaceAction: WorkspacePresetAction, workspacePreset: WorkspacePresetListItem) => void;
|
|
9
9
|
hideNewWorkspace?: boolean;
|
|
10
10
|
isEditable?: boolean;
|
|
@@ -4,7 +4,7 @@ export declare const WORKSPACE_SELECT_LIST_ROW_HEIGHT = 46;
|
|
|
4
4
|
export declare const getPresetIcon: (preset: WorkspacePresetListItem) => React.ReactElement;
|
|
5
5
|
interface WorkspaceSelectListRowProps {
|
|
6
6
|
workspacePreset: WorkspacePresetListItem;
|
|
7
|
-
|
|
7
|
+
onClickWorkspacePreset: (id: string) => void;
|
|
8
8
|
onClickWorkspacePresetOption: (presetId: string, workspaceAction: WorkspacePresetAction, workspacePreset: WorkspacePresetListItem) => void;
|
|
9
9
|
isOptionsMenuOpen?: boolean;
|
|
10
10
|
isEditable?: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { MosaicNode } from 'react-mosaic-component';
|
|
2
2
|
export declare const getUniqueId: (existingIds: string[], count?: number) => string;
|
|
3
3
|
export declare const createBalancedMosaicNode: (currentNode: MosaicNode<string>) => MosaicNode<string>;
|
|
4
|
+
export declare const closeTimeSeriesDialogsWhenChangingPreset: (componentTypes: string[] | undefined, dispatch: (action: unknown) => void) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AnyAction, ThunkDispatch } from '@reduxjs/toolkit';
|
|
2
|
-
import { WorkspaceModuleStore } from '../types';
|
|
3
|
-
export declare const workspaceListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<
|
|
2
|
+
import { AppStore, WorkspaceModuleStore } from '../types';
|
|
3
|
+
export declare const workspaceListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<AppStore, ThunkDispatch<AppStore, unknown, AnyAction>, unknown>;
|
|
4
4
|
export declare const fetchWorkspaceViewPreset: (dispatch: ThunkDispatch<WorkspaceModuleStore, unknown, AnyAction>, viewPresetId: string, mosaicNodeId: string) => Promise<void>;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Reducer } from '@reduxjs/toolkit';
|
|
2
|
-
import { WorkspaceAddViewPayload, WorkspaceDeleteViewPayload, WorkspaceState, WorkspaceSetPresetPayload, WorkspaceSetPreventCloseViewPayload, WorkspaceUpdateViewPayload, WorkspaceUpdateViewsPayload, WorkspaceErrorWorkspacePayload, WorkspaceFetchedWorkspacePayload, WorkspaceFetchWorkspacePayload, WorkspaceFetchWorkspaceViewPresetPayload, WorkspaceSaveWorkspacePresetPayload,
|
|
2
|
+
import { WorkspaceAddViewPayload, WorkspaceDeleteViewPayload, WorkspaceState, WorkspaceSetPresetPayload, WorkspaceSetPreventCloseViewPayload, WorkspaceUpdateViewPayload, WorkspaceUpdateViewsPayload, WorkspaceErrorWorkspacePayload, WorkspaceFetchedWorkspacePayload, WorkspaceFetchWorkspacePayload, WorkspaceFetchWorkspaceViewPresetPayload, WorkspaceSaveWorkspacePresetPayload, WorkspaceSetNewViewPayload, WorkspaceChangeToEmptyMapWorkspacePayload } from './types';
|
|
3
3
|
export declare const initialState: WorkspaceState;
|
|
4
4
|
export declare const reducer: Reducer<WorkspaceState>;
|
|
5
5
|
export declare const workspaceActions: {
|
|
6
|
-
setInitialViewMapPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetInitialViewMapPresetPayload, "workspace/setInitialViewMapPreset">;
|
|
7
6
|
addWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceAddViewPayload, "workspace/addWorkspaceView">;
|
|
8
7
|
setNewWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetNewViewPayload, "workspace/setNewWorkspaceView">;
|
|
9
8
|
deleteWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceDeleteViewPayload, "workspace/deleteWorkspaceView">;
|
|
10
9
|
updateWorkspaceViews: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceUpdateViewsPayload, "workspace/updateWorkspaceViews">;
|
|
11
10
|
updateWorkspaceView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceUpdateViewPayload, "workspace/updateWorkspaceView">;
|
|
12
11
|
changePreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetPresetPayload, "workspace/changePreset">;
|
|
13
|
-
changeToEmptyMapWorkspace: import("@reduxjs/toolkit").
|
|
12
|
+
changeToEmptyMapWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceChangeToEmptyMapWorkspacePayload, "workspace/changeToEmptyMapWorkspace">;
|
|
14
13
|
setPreset: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetPresetPayload, "workspace/setPreset">;
|
|
15
14
|
setPreventCloseView: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceSetPreventCloseViewPayload, "workspace/setPreventCloseView">;
|
|
16
15
|
fetchWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<WorkspaceFetchWorkspacePayload, "workspace/fetchWorkspace">;
|
|
@@ -13,12 +13,12 @@ export declare const getWorkspaceState: ((state: AppStore) => WorkspaceState) &
|
|
|
13
13
|
clearCache: () => void;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
* Gets
|
|
16
|
+
* Gets component types from the views used in the workspace
|
|
17
17
|
*
|
|
18
18
|
* @param {object} store store: object - Store object
|
|
19
|
-
* @returns {
|
|
19
|
+
* @returns {WorkspaceViewType.componentType[]} returnType: WorkspaceViewType.componentType[]
|
|
20
20
|
*/
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const getComponentTypesFromActiveViews: ((state: AppStore) => string[] | undefined) & import("reselect").OutputSelectorFields<(args_0: WorkspaceState | undefined) => string[] | undefined, {
|
|
22
22
|
clearCache: () => void;
|
|
23
23
|
}> & {
|
|
24
24
|
clearCache: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { syncGroupsTypes } from '@opengeoweb/store';
|
|
3
3
|
import { MosaicNode } from 'react-mosaic-component';
|
|
4
4
|
export type InitialPropsWorkspaceViewType = Record<string, unknown>;
|
|
5
5
|
export type WorkspaceViewPresetComponentsLookupType = 'ViewError' | 'ViewLoading';
|
|
@@ -42,7 +42,6 @@ export interface WorkspaceState extends WorkspacePreset {
|
|
|
42
42
|
isLoading?: boolean;
|
|
43
43
|
error?: WorkspaceError;
|
|
44
44
|
hasChanges?: boolean;
|
|
45
|
-
intialViewMapPreset?: MapPreset;
|
|
46
45
|
}
|
|
47
46
|
export interface WorkspacePresetFromBE {
|
|
48
47
|
id?: string;
|
|
@@ -73,9 +72,6 @@ export declare enum WorkspacePresetAction {
|
|
|
73
72
|
RESET = "RESET",
|
|
74
73
|
DELETE_SYSTEM_PRESET = "DELETE_SYSTEM_PRESET"
|
|
75
74
|
}
|
|
76
|
-
export interface WorkspaceSetInitialViewMapPresetPayload {
|
|
77
|
-
preset: MapPreset;
|
|
78
|
-
}
|
|
79
75
|
export interface WorkspaceAddViewPayload {
|
|
80
76
|
id: string;
|
|
81
77
|
componentType: string;
|
|
@@ -96,6 +92,10 @@ export interface WorkspaceUpdateViewPayload {
|
|
|
96
92
|
mosaicNodeId: string;
|
|
97
93
|
viewPreset: WorkspaceViewType;
|
|
98
94
|
}
|
|
95
|
+
export interface WorkspaceChangeToEmptyMapWorkspacePayload {
|
|
96
|
+
newMapPresetText: string;
|
|
97
|
+
newWorkspaceText: string;
|
|
98
|
+
}
|
|
99
99
|
export interface WorkspaceSetPresetPayload {
|
|
100
100
|
workspacePreset: WorkspacePreset;
|
|
101
101
|
}
|
|
@@ -2,7 +2,7 @@ import { ToolkitStore } from '@reduxjs/toolkit/dist/configureStore';
|
|
|
2
2
|
import { WorkspacePresetFromBE } from '../workspace/types';
|
|
3
3
|
import { ViewPresetEntity } from '../viewPresets/types';
|
|
4
4
|
import { WorkspaceModuleStore } from '../types';
|
|
5
|
-
export declare const emptyWorkspaceBEData: WorkspacePresetFromBE
|
|
5
|
+
export declare const emptyWorkspaceBEData: Omit<WorkspacePresetFromBE, 'title'>;
|
|
6
6
|
export declare const saveAllViewPresets: (viewPresetEntity: ViewPresetEntity, workspaceTitle: string, store: ToolkitStore, emptyMapPresetTitle: string) => Promise<{
|
|
7
7
|
mosaicNodeId: string;
|
|
8
8
|
viewPresetId: string;
|
|
@@ -86,15 +86,26 @@ export interface SubmitFormWorkspaceActionDialogPayload {
|
|
|
86
86
|
presetId: string;
|
|
87
87
|
data: WorkspacePresetFromBE;
|
|
88
88
|
emptyMapPresetTitle: string;
|
|
89
|
+
emptyWorkspacePresetTitle: string;
|
|
89
90
|
}
|
|
90
|
-
export interface
|
|
91
|
+
export interface OnNonDeleteSuccesWorkspacePresetActionPayload {
|
|
91
92
|
workspaceId: string;
|
|
92
|
-
action: WorkspacePresetAction
|
|
93
|
+
action: Exclude<WorkspacePresetAction, WorkspacePresetAction.DELETE | WorkspacePresetAction.DELETE_SYSTEM_PRESET>;
|
|
94
|
+
title: string;
|
|
95
|
+
abstract?: string;
|
|
96
|
+
currentActiveWorkspaceId?: string;
|
|
97
|
+
scope: PresetScope;
|
|
98
|
+
}
|
|
99
|
+
export interface OnDeleteSuccesWorkspacePresetActionPayload {
|
|
100
|
+
workspaceId: string;
|
|
101
|
+
action: WorkspacePresetAction.DELETE | WorkspacePresetAction.DELETE_SYSTEM_PRESET;
|
|
93
102
|
title: string;
|
|
94
103
|
abstract?: string;
|
|
95
104
|
currentActiveWorkspaceId?: string;
|
|
96
105
|
scope: PresetScope;
|
|
106
|
+
emptyWorkspacePresetTitle: string;
|
|
97
107
|
}
|
|
108
|
+
export type OnSuccesWorkspacePresetActionPayload = OnNonDeleteSuccesWorkspacePresetActionPayload | OnDeleteSuccesWorkspacePresetActionPayload;
|
|
98
109
|
export interface OnErrorWorkspacePresetActionPayload {
|
|
99
110
|
error: WorkspaceListError;
|
|
100
111
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { MapPreset } from '@opengeoweb/store';
|
|
2
2
|
import { snackbarTypes } from '@opengeoweb/snackbar';
|
|
3
|
+
import { TFunction } from 'i18next';
|
|
3
4
|
import { WorkspacePreset, WorkspacePresetAction, WorkspacePresetListItem } from '../workspace/types';
|
|
4
5
|
import { FetchWorkspaceParams, WorkspaceListFilter } from './types';
|
|
5
6
|
export declare const getSnackbarMessage: (action: WorkspacePresetAction, title: string) => snackbarTypes.TranslatableMessage;
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
7
|
+
export declare function getEmptyWorkspaceListItem(): Omit<WorkspacePresetListItem, 'title'>;
|
|
8
|
+
export declare function getEmptyWorkspaceListItem(t: TFunction): WorkspacePresetListItem;
|
|
9
|
+
export declare function getEmptyWorkspaceListItem(t?: TFunction): Omit<WorkspacePresetListItem, 'title'> | WorkspacePresetListItem;
|
|
10
|
+
export declare function getEmptyMapWorkspace(): Omit<WorkspacePreset, 'title'>;
|
|
11
|
+
export declare function getEmptyMapWorkspace(t: TFunction): WorkspacePreset;
|
|
12
|
+
export declare const getEmptyWorkspacePreset: () => Omit<WorkspacePreset, 'title'>;
|
|
13
|
+
export declare const createCustomEmptyMapWorkspace: (emptyWorkspaceTitle: string, emptyMapWorkspaceTitle: string, customMapPreset?: MapPreset) => WorkspacePreset;
|
|
10
14
|
export declare const constructFilterParams: (filters: WorkspaceListFilter[], searchQuery: string) => FetchWorkspaceParams;
|
|
11
15
|
export declare const generateUID: () => string;
|
|
12
16
|
export declare const getGeneratedViewPresetTitle: (workspaceTitle: string, uid: string) => string;
|
package/src/lib/utils/i18n.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import i18n from 'i18next';
|
|
1
|
+
import i18n, { TFunction } from 'i18next';
|
|
2
2
|
import { UseTranslationResponse } from 'react-i18next';
|
|
3
3
|
export declare const WORKSPACE_NAMESPACE = "workspace";
|
|
4
4
|
export declare const initWorkspaceTestI18n: () => void;
|
|
5
|
-
export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
|
|
5
|
+
export declare const translateKeyOutsideComponents: (t: TFunction, key: string, params?: Record<string, string | number> | undefined) => string;
|
|
6
6
|
export declare const useWorkspaceTranslation: () => UseTranslationResponse<typeof WORKSPACE_NAMESPACE, typeof i18n>;
|
|
7
7
|
export { i18n };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { uiTypes, WebMapStateModuleState } from '@opengeoweb/store';
|
|
2
|
+
import { Store } from '@reduxjs/toolkit';
|
|
3
|
+
import { WorkspaceModuleStore } from '../store/types';
|
|
4
|
+
export declare const createMockStore: (mockState: WorkspaceModuleStore & uiTypes.UIModuleState & WebMapStateModuleState) => Store;
|