@opengeoweb/workspace 10.1.0 → 10.2.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 +110 -75
- package/package.json +1 -1
- package/src/lib/components/ViewPresetsFormDialog/ViewPresetsFormDialog.d.ts +1 -1
- package/src/lib/components/WorkspaceDetail/WorkspaceDetail.stories.d.ts +1 -0
- package/src/lib/store/viewPresets/types.d.ts +3 -0
- package/src/lib/store/viewPresetsList/types.d.ts +1 -0
- package/src/lib/store/workspace/types.d.ts +1 -0
- package/src/lib/store/workspaceList/types.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -37,8 +37,7 @@ var en = {
|
|
|
37
37
|
"workspce-clear": "Clear",
|
|
38
38
|
"workspace-save": "Save",
|
|
39
39
|
"workspace-save-as": "Save as",
|
|
40
|
-
"workspace-edit": "Edit (name)",
|
|
41
|
-
"workspace-edit-both": "Edit (name and abstract)",
|
|
40
|
+
"workspace-edit": "Edit (name and abstract)",
|
|
42
41
|
"geoweb-welcome": "Welcome to GeoWeb. Please use one of the presets to open up new views",
|
|
43
42
|
"workspace-modified-new": "modified",
|
|
44
43
|
"workspace-modified-existing": "not saved",
|
|
@@ -117,8 +116,7 @@ var fi = {
|
|
|
117
116
|
"workspce-clear": "Tyhjennä",
|
|
118
117
|
"workspace-save": "Tallenna",
|
|
119
118
|
"workspace-save-as": "Tallenna nimellä",
|
|
120
|
-
"workspace-edit": "Muokkaa (nimeä)",
|
|
121
|
-
"workspace-edit-both": "Muokkaa (nimeä ja tiivistelmää)",
|
|
119
|
+
"workspace-edit": "Muokkaa (nimeä ja tiivistelmää)",
|
|
122
120
|
"geoweb-welcome": "Tervetuloa Geoweb-sovellukseen. Valitse jokin preset avataksesi uusia näkymiä",
|
|
123
121
|
"workspace-modified-new": "muokattu",
|
|
124
122
|
"workspace-modified-existing": "ei tallennettu",
|
|
@@ -194,8 +192,7 @@ var no = {
|
|
|
194
192
|
"workspce-clear": "Tøm",
|
|
195
193
|
"workspace-save": "Lagre",
|
|
196
194
|
"workspace-save-as": "Lagre som",
|
|
197
|
-
"workspace-edit": "Endre (navn)",
|
|
198
|
-
"workspace-edit-both": "Endre (navn og abstrakt)",
|
|
195
|
+
"workspace-edit": "Endre (navn og abstrakt)",
|
|
199
196
|
"geoweb-welcome": "Velkommen til GeoWeb. Åpne et forhåndsvalg for å åpne nye vinduer",
|
|
200
197
|
"workspace-modified-new": "modifisert",
|
|
201
198
|
"workspace-modified-existing": "ikke lagret",
|
|
@@ -271,8 +268,7 @@ var nl = {
|
|
|
271
268
|
"workspce-clear": "Wissen",
|
|
272
269
|
"workspace-save": "Opslaan",
|
|
273
270
|
"workspace-save-as": "Opslaan als",
|
|
274
|
-
"workspace-edit": "Aanpassen (naam)",
|
|
275
|
-
"workspace-edit-both": "Aanpassen (naam en abstract)",
|
|
271
|
+
"workspace-edit": "Aanpassen (naam en abstract)",
|
|
276
272
|
"geoweb-welcome": "Welkom bij GeoWeb. Kies een van de presets om een nieuw venster te openen",
|
|
277
273
|
"workspace-modified-new": "bewerkt",
|
|
278
274
|
"workspace-modified-existing": "niet opgeslagen",
|
|
@@ -1114,7 +1110,7 @@ var viewPresetsAdapter = createEntityAdapter({
|
|
|
1114
1110
|
var initialState$2 = viewPresetsAdapter.getInitialState();
|
|
1115
1111
|
var warningsPresetChangeActions = [publicWarningActions.setWarningFilters];
|
|
1116
1112
|
var syncGroupChangeActions = [syncGroupsActions.syncGroupRemoveTarget, syncGroupsActions.syncGroupAddTarget];
|
|
1117
|
-
var mapPresetChangeActions = [layerActions.setBaseLayers, layerActions.layerDelete, layerActions.addLayer, layerActions.duplicateMapLayer, layerActions.layerChangeEnabled, layerActions.layerChangeName, layerActions.layerChangeStyle, layerActions.layerChangeOpacity, layerActions.layerChangeDimension, mapActions.layerMoveLayer, mapActions.setAutoLayerId, mapActions.toggleAutoUpdate, mapActions.mapStartAnimation, mapActions.mapStopAnimation, mapActions.toggleTimeSliderIsVisible, mapActions.setTimeStep, mapActions.setAnimationDelay, mapActions.toggleTimestepAuto, mapActions.setAnimationStartTime, mapActions.setAnimationEndTime, uiActions.setActiveMapIdForDialog, uiActions.setToggleOpenDialog, genericActions.setBbox, mapActions.setBbox];
|
|
1113
|
+
var mapPresetChangeActions = [layerActions.setBaseLayers, layerActions.layerDelete, layerActions.addLayer, layerActions.duplicateMapLayer, layerActions.layerChangeEnabled, layerActions.layerChangeName, layerActions.layerChangeStyle, layerActions.layerChangeOpacity, layerActions.layerChangeDimension, mapActions.layerMoveLayer, mapActions.setAutoLayerId, mapActions.toggleAutoUpdate, mapActions.mapStartAnimation, mapActions.mapStopAnimation, mapActions.toggleTimeSliderIsVisible, mapActions.setTimeStep, mapActions.setTimeSliderSpan, mapActions.toggleTimeSpanAuto, mapActions.setAnimationDelay, mapActions.toggleTimestepAuto, mapActions.setAnimationStartTime, mapActions.setAnimationEndTime, uiActions.setActiveMapIdForDialog, uiActions.setToggleOpenDialog, genericActions.setBbox, mapActions.setBbox];
|
|
1118
1114
|
var timeSeriesPresetChangeActions = [timeSeriesActions.addParameter, timeSeriesActions.addPlot, timeSeriesActions.deleteParameter, timeSeriesActions.deletePlot, timeSeriesActions.moveParameter, timeSeriesActions.movePlot, timeSeriesActions.toggleParameter, timeSeriesActions.togglePlot, timeSeriesActions.patchParameter, timeSeriesActions.updateTitle];
|
|
1119
1115
|
var supportedMapActionOrigins = [layerTypes.LayerActionOrigin.layerManager, layerTypes.LayerActionOrigin.wmsLoader, mapEnums.MapActionOrigin.map];
|
|
1120
1116
|
var supportedTimeSeriesActionOrigins = [TimeSeriesTypes.TimeSeriesActionOrigin.timeSeriesManager, TimeSeriesTypes.TimeSeriesActionOrigin.timeSeriesSelect];
|
|
@@ -1910,11 +1906,13 @@ var slice$1 = createSlice({
|
|
|
1910
1906
|
panelId = _action$payload5.panelId,
|
|
1911
1907
|
title = _action$payload5.title,
|
|
1912
1908
|
presetAction = _action$payload5.action,
|
|
1913
|
-
scope = _action$payload5.scope
|
|
1909
|
+
scope = _action$payload5.scope,
|
|
1910
|
+
_abstract = _action$payload5["abstract"];
|
|
1914
1911
|
var entity = draft.views.byId[panelId];
|
|
1915
1912
|
if (entity && presetAction !== PresetAction.DELETE) {
|
|
1916
1913
|
entity.title = title;
|
|
1917
1914
|
entity.scope = scope || 'user';
|
|
1915
|
+
entity["abstract"] = _abstract;
|
|
1918
1916
|
}
|
|
1919
1917
|
});
|
|
1920
1918
|
workspacePresetChangeActions.map(function (action) {
|
|
@@ -1934,6 +1932,7 @@ var slice$1 = createSlice({
|
|
|
1934
1932
|
if (entity && viewPresetId === '') {
|
|
1935
1933
|
entity.title = '';
|
|
1936
1934
|
entity.scope = 'system';
|
|
1935
|
+
entity["abstract"] = '';
|
|
1937
1936
|
}
|
|
1938
1937
|
}
|
|
1939
1938
|
});
|
|
@@ -3107,6 +3106,7 @@ var viewPresetsListFullContent = [
|
|
|
3107
3106
|
{
|
|
3108
3107
|
id: "radar",
|
|
3109
3108
|
title: "Radar",
|
|
3109
|
+
abstract: "abstract radar",
|
|
3110
3110
|
componentType: "Map",
|
|
3111
3111
|
initialProps: {
|
|
3112
3112
|
mapPreset: {
|
|
@@ -4328,6 +4328,7 @@ var viewPresetsListFullContent = [
|
|
|
4328
4328
|
var viewPresetsList = [
|
|
4329
4329
|
{
|
|
4330
4330
|
title: "Radar",
|
|
4331
|
+
abstract: "abstract radar",
|
|
4331
4332
|
id: "radar",
|
|
4332
4333
|
date: "2022-06-01T12:34:27.787184",
|
|
4333
4334
|
scope: "system"
|
|
@@ -4498,7 +4499,8 @@ var viewPresetsList = [
|
|
|
4498
4499
|
title: "Cap Warnings",
|
|
4499
4500
|
id: "capView",
|
|
4500
4501
|
date: "2022-06-01T12:34:27.787184",
|
|
4501
|
-
scope: "system"
|
|
4502
|
+
scope: "system",
|
|
4503
|
+
abstract: "abstract cap"
|
|
4502
4504
|
},
|
|
4503
4505
|
{
|
|
4504
4506
|
title: "Warning List",
|
|
@@ -5753,6 +5755,8 @@ workspaceListListener.startListening({
|
|
|
5753
5755
|
case 0:
|
|
5754
5756
|
viewPresetEntity = Object.assign({}, getViewPresetToSendToBackend(listenerApi.getState(), view.mosaicNodeId), {
|
|
5755
5757
|
title: view.title
|
|
5758
|
+
}, view["abstract"] && {
|
|
5759
|
+
"abstract": view["abstract"]
|
|
5756
5760
|
});
|
|
5757
5761
|
shouldUpdateView = view.hasChanges && view.isSelected;
|
|
5758
5762
|
canUpdateView = scope === 'system' || scope === viewPresetEntity.scope; // save existing views
|
|
@@ -6182,12 +6186,12 @@ var WorkspaceModuleProvider = function WorkspaceModuleProvider(_ref) {
|
|
|
6182
6186
|
});
|
|
6183
6187
|
};
|
|
6184
6188
|
|
|
6185
|
-
var _excluded$
|
|
6189
|
+
var _excluded$5 = ["component", "payload"];
|
|
6186
6190
|
// takes a component and connects module methods with workspace store
|
|
6187
6191
|
var ComponentsLookUpWrapper = function ComponentsLookUpWrapper(_ref) {
|
|
6188
6192
|
var component = _ref.component,
|
|
6189
6193
|
payload = _ref.payload,
|
|
6190
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6194
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
6191
6195
|
var RenderComponent = component;
|
|
6192
6196
|
var dispatch = useDispatch();
|
|
6193
6197
|
var viewId = payload.id;
|
|
@@ -6602,12 +6606,11 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
|
|
|
6602
6606
|
var onEdit = function onEdit() {
|
|
6603
6607
|
onClickWorkspacePresetOption(workspacePreset.id, WorkspacePresetAction.EDIT, workspacePreset);
|
|
6604
6608
|
};
|
|
6605
|
-
var editTitle = testIdPrefix === 'viewpreset' ? 'workspace-edit' : 'workspace-edit-both';
|
|
6606
6609
|
var menuItems = [{
|
|
6607
6610
|
text: t('workspace-duplicate'),
|
|
6608
6611
|
action: onDuplicate
|
|
6609
6612
|
}].concat(workspacePreset.scope === 'user' || isAdmin ? [{
|
|
6610
|
-
text: t(
|
|
6613
|
+
text: t('workspace-edit'),
|
|
6611
6614
|
action: onEdit
|
|
6612
6615
|
}] : []);
|
|
6613
6616
|
return jsx(ListItem, {
|
|
@@ -6865,7 +6868,8 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
6865
6868
|
panelId: panelId,
|
|
6866
6869
|
formValues: {
|
|
6867
6870
|
title: preset.title,
|
|
6868
|
-
initialProps: constructInitialProps()
|
|
6871
|
+
initialProps: constructInitialProps(),
|
|
6872
|
+
"abstract": preset["abstract"]
|
|
6869
6873
|
}
|
|
6870
6874
|
});
|
|
6871
6875
|
break;
|
|
@@ -6879,7 +6883,8 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
|
|
|
6879
6883
|
panelId: panelId,
|
|
6880
6884
|
viewPresetId: presetId,
|
|
6881
6885
|
formValues: {
|
|
6882
|
-
title: presetTitle
|
|
6886
|
+
title: presetTitle,
|
|
6887
|
+
"abstract": preset["abstract"]
|
|
6883
6888
|
}
|
|
6884
6889
|
});
|
|
6885
6890
|
break;
|
|
@@ -7090,7 +7095,6 @@ var WorkspaceOptionsNoMemo = function WorkspaceOptionsNoMemo(_ref) {
|
|
|
7090
7095
|
}
|
|
7091
7096
|
}, [isDefaultOpen, id]);
|
|
7092
7097
|
var isViewPresetsOptions = id === viewPresetOptionId;
|
|
7093
|
-
var editTitle = isViewPresetsOptions ? t('workspace-edit') : t('workspace-edit-both');
|
|
7094
7098
|
var saveAsTitle = isAdmin && !isViewPresetsOptions ? t('workspace-admin-save-new-workspace') : t('workspace-save-as');
|
|
7095
7099
|
var isAdminWorkspaceOptions = isAdmin && id === workspacePresetOptionId;
|
|
7096
7100
|
var options = [{
|
|
@@ -7100,7 +7104,7 @@ var WorkspaceOptionsNoMemo = function WorkspaceOptionsNoMemo(_ref) {
|
|
|
7100
7104
|
title: saveAsTitle,
|
|
7101
7105
|
callback: handleSaveAs
|
|
7102
7106
|
}].concat(!isAdminWorkspaceOptions ? [{
|
|
7103
|
-
title:
|
|
7107
|
+
title: t('workspace-edit'),
|
|
7104
7108
|
callback: handleEdit
|
|
7105
7109
|
}] : [], [{
|
|
7106
7110
|
title: t('workspace-reset'),
|
|
@@ -7225,6 +7229,7 @@ var LoadingIndicatorConnect = function LoadingIndicatorConnect(_ref) {
|
|
|
7225
7229
|
});
|
|
7226
7230
|
};
|
|
7227
7231
|
|
|
7232
|
+
var _excluded$4 = ["title", "scope"];
|
|
7228
7233
|
var customIconStyles = function customIconStyles(theme, isViewPresetDialogOpen) {
|
|
7229
7234
|
return {
|
|
7230
7235
|
marginLeft: -1,
|
|
@@ -7256,11 +7261,12 @@ var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_
|
|
|
7256
7261
|
var _workspaceSelectors$g;
|
|
7257
7262
|
var _ref2 = (_workspaceSelectors$g = getViewById(store, panelId)) != null ? _workspaceSelectors$g : {},
|
|
7258
7263
|
title = _ref2.title,
|
|
7259
|
-
scope = _ref2.scope
|
|
7260
|
-
|
|
7264
|
+
scope = _ref2.scope,
|
|
7265
|
+
restProps = _objectWithoutPropertiesLoose(_ref2, _excluded$4);
|
|
7266
|
+
return Object.assign({
|
|
7261
7267
|
title: title,
|
|
7262
7268
|
scope: scope
|
|
7263
|
-
};
|
|
7269
|
+
}, restProps);
|
|
7264
7270
|
}, shallowEqual);
|
|
7265
7271
|
var viewComponentType = useSelector(function (store) {
|
|
7266
7272
|
return getViewComponentType(store, panelId);
|
|
@@ -7274,6 +7280,7 @@ var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_
|
|
|
7274
7280
|
var relatedSyncGroupIds = useSelector(function (store) {
|
|
7275
7281
|
return syncGroupsSelectors.getAllTargetGroupsForSource(store, panelId);
|
|
7276
7282
|
});
|
|
7283
|
+
var presetAbstract = workspaceView == null ? void 0 : workspaceView["abstract"];
|
|
7277
7284
|
var isNewActive = activeViewPresetId === '';
|
|
7278
7285
|
var title = workspaceView.title || t('workspace-mappreset-new');
|
|
7279
7286
|
var viewScope = workspaceView.scope;
|
|
@@ -7318,10 +7325,11 @@ var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_
|
|
|
7318
7325
|
viewPresetId: activeViewPresetId,
|
|
7319
7326
|
panelId: panelId,
|
|
7320
7327
|
formValues: {
|
|
7321
|
-
title: title
|
|
7328
|
+
title: title,
|
|
7329
|
+
"abstract": presetAbstract
|
|
7322
7330
|
}
|
|
7323
7331
|
});
|
|
7324
|
-
}, [activeViewPresetId, openViewPresetsDialog, panelId, title, t]);
|
|
7332
|
+
}, [activeViewPresetId, openViewPresetsDialog, panelId, title, presetAbstract, t]);
|
|
7325
7333
|
var onSaveAs = React.useCallback(function () {
|
|
7326
7334
|
var formTitle = activeViewPresetId ? title : '';
|
|
7327
7335
|
openViewPresetsDialog({
|
|
@@ -7331,10 +7339,11 @@ var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_
|
|
|
7331
7339
|
panelId: panelId,
|
|
7332
7340
|
formValues: {
|
|
7333
7341
|
title: formTitle,
|
|
7334
|
-
initialProps: constructInitialProps()
|
|
7342
|
+
initialProps: constructInitialProps(),
|
|
7343
|
+
"abstract": presetAbstract
|
|
7335
7344
|
}
|
|
7336
7345
|
});
|
|
7337
|
-
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title]);
|
|
7346
|
+
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title, presetAbstract]);
|
|
7338
7347
|
var onEdit = React.useCallback(function () {
|
|
7339
7348
|
var formTitle = activeViewPresetId ? title : '';
|
|
7340
7349
|
openViewPresetsDialog({
|
|
@@ -7344,10 +7353,11 @@ var WorkspaceViewTitleConnectNoMemo = function WorkspaceViewTitleConnectNoMemo(_
|
|
|
7344
7353
|
viewPresetId: activeViewPresetId,
|
|
7345
7354
|
formValues: {
|
|
7346
7355
|
title: formTitle,
|
|
7347
|
-
initialProps: constructInitialProps()
|
|
7356
|
+
initialProps: constructInitialProps(),
|
|
7357
|
+
"abstract": presetAbstract
|
|
7348
7358
|
}
|
|
7349
7359
|
});
|
|
7350
|
-
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title]);
|
|
7360
|
+
}, [activeViewPresetId, constructInitialProps, openViewPresetsDialog, panelId, t, title, presetAbstract]);
|
|
7351
7361
|
var onReset = React.useCallback(function () {
|
|
7352
7362
|
openViewPresetsDialog({
|
|
7353
7363
|
title: t('workspace-reset-title'),
|
|
@@ -8246,6 +8256,7 @@ var HelperText = function HelperText(_ref) {
|
|
|
8246
8256
|
children: text
|
|
8247
8257
|
});
|
|
8248
8258
|
};
|
|
8259
|
+
var inputMargin = 2;
|
|
8249
8260
|
var ViewPresetItem = function ViewPresetItem(_ref2) {
|
|
8250
8261
|
var index = _ref2.index,
|
|
8251
8262
|
viewPreset = _ref2.viewPreset,
|
|
@@ -8285,6 +8296,7 @@ var ViewPresetItem = function ViewPresetItem(_ref2) {
|
|
|
8285
8296
|
}
|
|
8286
8297
|
}, [error, fieldNameTitle, setError]);
|
|
8287
8298
|
var shouldShowInput = isNew && isChecked || isChecked && !isAdmin && viewPreset.scope === 'system';
|
|
8299
|
+
var isInputDisabled = isLoading || !hasChanges;
|
|
8288
8300
|
return jsxs(React__default.Fragment, {
|
|
8289
8301
|
children: [jsx(FormControlLabel, {
|
|
8290
8302
|
control: jsx(Checkbox, {}),
|
|
@@ -8315,11 +8327,23 @@ var ViewPresetItem = function ViewPresetItem(_ref2) {
|
|
|
8315
8327
|
rules: {
|
|
8316
8328
|
required: true
|
|
8317
8329
|
},
|
|
8318
|
-
disabled:
|
|
8330
|
+
disabled: isInputDisabled,
|
|
8319
8331
|
sx: {
|
|
8320
|
-
|
|
8332
|
+
mb: inputMargin
|
|
8321
8333
|
},
|
|
8322
8334
|
error: error !== undefined
|
|
8335
|
+
}), jsx(ReactHookFormTextField, {
|
|
8336
|
+
name: "views." + index + ".abstract",
|
|
8337
|
+
label: t('workspace-dialog-abstract'),
|
|
8338
|
+
rules: {
|
|
8339
|
+
required: false
|
|
8340
|
+
},
|
|
8341
|
+
multiline: true,
|
|
8342
|
+
rows: 3,
|
|
8343
|
+
disabled: isInputDisabled,
|
|
8344
|
+
sx: {
|
|
8345
|
+
mb: inputMargin
|
|
8346
|
+
}
|
|
8323
8347
|
}), jsx(HelperText, {
|
|
8324
8348
|
text: t(getNewPresetWarningText(isAdmin, isNew))
|
|
8325
8349
|
})]
|
|
@@ -8557,7 +8581,7 @@ var WorkspacePresetsFormDialog = function WorkspacePresetsFormDialog(_ref) {
|
|
|
8557
8581
|
}
|
|
8558
8582
|
case WorkspacePresetAction.EDIT:
|
|
8559
8583
|
{
|
|
8560
|
-
return t('workspace-edit
|
|
8584
|
+
return t('workspace-edit');
|
|
8561
8585
|
}
|
|
8562
8586
|
case WorkspacePresetAction.SAVE:
|
|
8563
8587
|
{
|
|
@@ -8725,6 +8749,7 @@ var validateTitle = function validateTitle(value) {
|
|
|
8725
8749
|
// TODO: use translation from form-fields https://gitlab.com/opengeoweb/opengeoweb/-/issues/4240
|
|
8726
8750
|
return !value.trim().length ? 'This field is required' : true;
|
|
8727
8751
|
};
|
|
8752
|
+
var marginBottom = 2;
|
|
8728
8753
|
var ViewPresetsForm = function ViewPresetsForm(_ref) {
|
|
8729
8754
|
var viewComponentType = _ref.viewComponentType,
|
|
8730
8755
|
error = _ref.error,
|
|
@@ -8755,7 +8780,7 @@ var ViewPresetsForm = function ViewPresetsForm(_ref) {
|
|
|
8755
8780
|
return jsxs(Fragment, {
|
|
8756
8781
|
children: [Boolean(error) && jsx(Box, {
|
|
8757
8782
|
sx: {
|
|
8758
|
-
|
|
8783
|
+
mb: marginBottom
|
|
8759
8784
|
},
|
|
8760
8785
|
children: jsx(AlertBanner, {
|
|
8761
8786
|
title: error
|
|
@@ -8772,7 +8797,18 @@ var ViewPresetsForm = function ViewPresetsForm(_ref) {
|
|
|
8772
8797
|
validateTitle: validateTitle
|
|
8773
8798
|
}
|
|
8774
8799
|
},
|
|
8775
|
-
defaultValue: title
|
|
8800
|
+
defaultValue: title,
|
|
8801
|
+
sx: {
|
|
8802
|
+
mb: marginBottom
|
|
8803
|
+
}
|
|
8804
|
+
}), jsx(ReactHookFormTextField, {
|
|
8805
|
+
name: "abstract",
|
|
8806
|
+
label: t('workspace-dialog-abstract'),
|
|
8807
|
+
rules: {
|
|
8808
|
+
required: false
|
|
8809
|
+
},
|
|
8810
|
+
multiline: true,
|
|
8811
|
+
rows: 3
|
|
8776
8812
|
}), hiddenFields.map(function (_ref2) {
|
|
8777
8813
|
var name = _ref2.name,
|
|
8778
8814
|
value = _ref2.value;
|
|
@@ -8866,77 +8902,75 @@ var ViewPresetsFormDialog = function ViewPresetsFormDialog(_ref) {
|
|
|
8866
8902
|
var confirmLabel = getConfirmLabel(action);
|
|
8867
8903
|
var onFormSubmit = /*#__PURE__*/function () {
|
|
8868
8904
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(formValues) {
|
|
8869
|
-
var scope, newFormValues, newId, _yield$api$getViewPre, originalViewPreset, viewPresetEdited, submitError, message;
|
|
8905
|
+
var scope, handleSuccess, newFormValues, newId, _yield$api$getViewPre, originalViewPreset, viewPresetEdited, submitError, message;
|
|
8870
8906
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8871
8907
|
while (1) switch (_context.prev = _context.next) {
|
|
8872
8908
|
case 0:
|
|
8873
8909
|
scope = isAdmin ? 'system' : formValues.scope;
|
|
8910
|
+
handleSuccess = function handleSuccess(id) {
|
|
8911
|
+
setIsLoading(false);
|
|
8912
|
+
onClose();
|
|
8913
|
+
onSuccess(action, id, newFormValues.title, newFormValues["abstract"]);
|
|
8914
|
+
};
|
|
8874
8915
|
newFormValues = Object.assign({}, formValues, {
|
|
8875
8916
|
scope: scope
|
|
8876
8917
|
});
|
|
8877
|
-
_context.prev =
|
|
8918
|
+
_context.prev = 3;
|
|
8878
8919
|
setError(null);
|
|
8879
8920
|
setIsLoading(true);
|
|
8880
8921
|
_context.t0 = action;
|
|
8881
|
-
_context.next = _context.t0 === PresetAction.SAVE_AS ?
|
|
8922
|
+
_context.next = _context.t0 === PresetAction.SAVE_AS ? 9 : _context.t0 === PresetAction.DELETE ? 14 : _context.t0 === PresetAction.EDIT ? 18 : _context.t0 === PresetAction.RESET ? 27 : 30;
|
|
8882
8923
|
break;
|
|
8883
|
-
case
|
|
8884
|
-
_context.next =
|
|
8924
|
+
case 9:
|
|
8925
|
+
_context.next = 11;
|
|
8885
8926
|
return api.saveViewPresetAs(newFormValues);
|
|
8886
|
-
case
|
|
8927
|
+
case 11:
|
|
8887
8928
|
newId = _context.sent;
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
case 15:
|
|
8893
|
-
_context.next = 17;
|
|
8929
|
+
handleSuccess(newId);
|
|
8930
|
+
return _context.abrupt("break", 31);
|
|
8931
|
+
case 14:
|
|
8932
|
+
_context.next = 16;
|
|
8894
8933
|
return api.deleteViewPreset(viewPresetId);
|
|
8895
|
-
case
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
case 21:
|
|
8901
|
-
_context.next = 23;
|
|
8934
|
+
case 16:
|
|
8935
|
+
handleSuccess(viewPresetId);
|
|
8936
|
+
return _context.abrupt("break", 31);
|
|
8937
|
+
case 18:
|
|
8938
|
+
_context.next = 20;
|
|
8902
8939
|
return api.getViewPreset(viewPresetId);
|
|
8903
|
-
case
|
|
8940
|
+
case 20:
|
|
8904
8941
|
_yield$api$getViewPre = _context.sent;
|
|
8905
8942
|
originalViewPreset = _yield$api$getViewPre.data;
|
|
8906
8943
|
viewPresetEdited = Object.assign({}, originalViewPreset, {
|
|
8907
8944
|
title: newFormValues.title,
|
|
8945
|
+
"abstract": newFormValues["abstract"],
|
|
8908
8946
|
scope: scope
|
|
8909
8947
|
});
|
|
8910
|
-
_context.next =
|
|
8948
|
+
_context.next = 25;
|
|
8911
8949
|
return api.saveViewPreset(viewPresetId, viewPresetEdited);
|
|
8912
|
-
case
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
return _context.abrupt("break", 38);
|
|
8917
|
-
case 32:
|
|
8950
|
+
case 25:
|
|
8951
|
+
handleSuccess(viewPresetId);
|
|
8952
|
+
return _context.abrupt("break", 31);
|
|
8953
|
+
case 27:
|
|
8918
8954
|
onReset(viewPresetId);
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
return _context.abrupt("break",
|
|
8923
|
-
case
|
|
8924
|
-
|
|
8925
|
-
case 38:
|
|
8926
|
-
_context.next = 46;
|
|
8955
|
+
handleSuccess(viewPresetId);
|
|
8956
|
+
return _context.abrupt("break", 31);
|
|
8957
|
+
case 30:
|
|
8958
|
+
return _context.abrupt("break", 31);
|
|
8959
|
+
case 31:
|
|
8960
|
+
_context.next = 39;
|
|
8927
8961
|
break;
|
|
8928
|
-
case
|
|
8929
|
-
_context.prev =
|
|
8930
|
-
_context.t1 = _context["catch"](
|
|
8962
|
+
case 33:
|
|
8963
|
+
_context.prev = 33;
|
|
8964
|
+
_context.t1 = _context["catch"](3);
|
|
8931
8965
|
setIsLoading(false);
|
|
8932
8966
|
submitError = _context.t1;
|
|
8933
8967
|
message = isAxiosError$1(submitError) ? getAxiosErrorMessage(submitError) : submitError.message;
|
|
8934
8968
|
setError(message);
|
|
8935
|
-
case
|
|
8969
|
+
case 39:
|
|
8936
8970
|
case "end":
|
|
8937
8971
|
return _context.stop();
|
|
8938
8972
|
}
|
|
8939
|
-
}, _callee, null, [[
|
|
8973
|
+
}, _callee, null, [[3, 33]]);
|
|
8940
8974
|
}));
|
|
8941
8975
|
return function onFormSubmit(_x) {
|
|
8942
8976
|
return _ref2.apply(this, arguments);
|
|
@@ -9035,13 +9069,14 @@ var ViewPresetsFormDialogConnect = function ViewPresetsFormDialogConnect(_ref) {
|
|
|
9035
9069
|
var onClose = function onClose() {
|
|
9036
9070
|
closeDialog();
|
|
9037
9071
|
};
|
|
9038
|
-
var onSuccess = function onSuccess(action, newViewPresetId, title) {
|
|
9072
|
+
var onSuccess = function onSuccess(action, newViewPresetId, title, _abstract) {
|
|
9039
9073
|
dispatch(viewPresetActions.onSuccessViewPresetAction({
|
|
9040
9074
|
panelId: panelId,
|
|
9041
9075
|
viewPresetId: newViewPresetId,
|
|
9042
9076
|
action: action,
|
|
9043
9077
|
title: title,
|
|
9044
|
-
scope: scope
|
|
9078
|
+
scope: scope,
|
|
9079
|
+
"abstract": _abstract
|
|
9045
9080
|
}));
|
|
9046
9081
|
};
|
|
9047
9082
|
var isOpen = dialogOptions !== undefined;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ export interface ViewPresetsFormDialogProps {
|
|
|
7
7
|
viewPresetId: string;
|
|
8
8
|
viewComponentType: WorkspaceSupportedComponentTypes;
|
|
9
9
|
formValues: ViewPresetFormValues;
|
|
10
|
-
onSuccess: (action: PresetAction, presetId: string, title: string) => void;
|
|
10
|
+
onSuccess: (action: PresetAction, presetId: string, title: string, abstract: string) => void;
|
|
11
11
|
onClose: () => void;
|
|
12
12
|
onReset: (viewPresetId: string) => void;
|
|
13
13
|
}
|
|
@@ -7,3 +7,4 @@ export declare const ScreenConfigRadarTemp: () => React.ReactElement;
|
|
|
7
7
|
export declare const ScreenConfigHarmoniePresetWithoutMultiMapLayerManager: () => React.ReactElement;
|
|
8
8
|
export declare const ScreenConfigHarmoniePresetWithMultiMapLayerManager: () => React.ReactElement;
|
|
9
9
|
export declare const UiDialogsDemo: () => React.ReactElement;
|
|
10
|
+
export declare const ScreenConfigWithNonExistingLayer: () => React.ReactElement;
|
|
@@ -8,6 +8,7 @@ export type WorkspaceSupportedComponentTypes = SupportedComponentTypes | Support
|
|
|
8
8
|
export interface ViewPreset {
|
|
9
9
|
id?: string;
|
|
10
10
|
title: string;
|
|
11
|
+
abstract?: string;
|
|
11
12
|
keywords: string;
|
|
12
13
|
componentType: WorkspaceSupportedComponentTypes;
|
|
13
14
|
initialProps?: InitialProps;
|
|
@@ -46,6 +47,7 @@ export interface ViewPresetEntity {
|
|
|
46
47
|
}
|
|
47
48
|
export interface ViewPresetFormValues {
|
|
48
49
|
title?: string;
|
|
50
|
+
abstract?: string;
|
|
49
51
|
initialProps?: InitialProps;
|
|
50
52
|
}
|
|
51
53
|
export interface ViewPresetDialog {
|
|
@@ -113,6 +115,7 @@ export interface OnSuccesViewPresetActionPayload extends ViewPresetAction {
|
|
|
113
115
|
title: string;
|
|
114
116
|
componentType?: string;
|
|
115
117
|
scope?: PresetScope;
|
|
118
|
+
abstract?: string;
|
|
116
119
|
}
|
|
117
120
|
export interface SelectViewPresetPayload extends ViewPresetAction {
|
|
118
121
|
viewPresetId: string;
|
|
@@ -6,6 +6,7 @@ export type WorkspaceViewPresetComponentsLookupType = 'ViewError' | 'ViewLoading
|
|
|
6
6
|
export interface WorkspaceViewType {
|
|
7
7
|
id?: string;
|
|
8
8
|
title?: string;
|
|
9
|
+
abstract?: string;
|
|
9
10
|
componentType: string | WorkspaceViewPresetComponentsLookupType;
|
|
10
11
|
initialProps?: InitialPropsWorkspaceViewType;
|
|
11
12
|
activeLayerId?: string;
|