Skip to content

Commit

Permalink
geosolutions-it#9889: Fix - Unable to export map configuration in con…
Browse files Browse the repository at this point in the history
…text manager
  • Loading branch information
dsuren1 committed Jan 18, 2024
1 parent ffe9cca commit 2a5472f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 1 addition & 3 deletions web/client/components/contextcreator/ContextCreator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ export default class ContextCreator extends React.Component {
editingAllowedRoles: []
}
}
},
"ContextImport",
"ContextExport"
}
],
ignoreViewerPlugins: false,
allAvailablePlugins: [],
Expand Down
2 changes: 1 addition & 1 deletion web/client/epics/__tests__/contextcreator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ describe('contextcreator epics', () => {
it('exportContextEpic, export context with plugins and themes', (done) => {
testEpic(exportContextEpic, 1, onContextExport('file.json'), ([a]) => {
expect(a.type).toEqual(TOGGLE_CONTROL);
expect(a.control).toEqual("export");
expect(a.control).toEqual("export-context");
done();
}, {
map: {
Expand Down
2 changes: 1 addition & 1 deletion web/client/epics/contextcreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ export const exportContextEpic = (action$, { getState }) =>
"application/json"
])
.do((downloadArgs) => download(...downloadArgs))
.map(() => toggleControl("export"))
.map(() => toggleControl("export-context"))
.catch(() =>
Rx.Observable.of(
error({
Expand Down
7 changes: 4 additions & 3 deletions web/client/plugins/ContextExport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { onContextExport } from "../actions/contextcreator";
import { toggleControl } from "../actions/controls";
import Message from "../components/I18N/Message";
import Button from "../components/misc/Button";
const isEnabled = createControlEnabledSelector("export");
const EXPORT_CONTROL = "export-context";
const isEnabled = createControlEnabledSelector(EXPORT_CONTROL);

const mapStateToProps = createSelector(
isEnabled,
Expand All @@ -32,7 +33,7 @@ const mapStateToProps = createSelector(
);

const actions = {
onClose: () => toggleControl("export"),
onClose: () => toggleControl(EXPORT_CONTROL),
onExport: onContextExport
};

Expand All @@ -58,7 +59,7 @@ const ExportComponent = connect(mapStateToProps, actions)(Component);
const ExportButton = connect(
createSelector(resourceSelector, (resource) => ({ resource })),
{
onExport: () => toggleControl("export")
onExport: () => toggleControl(EXPORT_CONTROL)
}
)(({ resource, onExport }) => (
<Button
Expand Down
2 changes: 1 addition & 1 deletion web/client/plugins/__tests__/ContextExport-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('ContextExport plugin', () => {
it('displays the export panel when enabled', () => {
const { Plugin } = getPluginForTest(ContextExport, {
controls: {
"export": {
"export-context": {
enabled: true
}
}
Expand Down

0 comments on commit 2a5472f

Please sign in to comment.