Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions geonode_mapstore_client/client/js/epics/gnresource.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,10 @@ const resourceTypes = {
newResourceObservable: (options) =>
Observable.defer(() => getNewGeoStoryConfig())
.switchMap((gnGeoStory) => {
const currentStory = options.data || {...gnGeoStory, sections: [{...gnGeoStory.sections[0], id: uuid(),
contents: [{...gnGeoStory.sections[0].contents[0], id: uuid()}]}]};
return Observable.of(
setCurrentStory(options.data || {...gnGeoStory, sections: [{...gnGeoStory.sections[0], id: uuid(),
contents: [{...gnGeoStory.sections[0].contents[0], id: uuid()}]}]}),
setCurrentStory({...currentStory, defaultGeoStoryConfig: {...currentStory}}),
setEditing(true),
setGeoStoryResource({
canEdit: true
Expand Down
18 changes: 14 additions & 4 deletions geonode_mapstore_client/client/js/epics/gnsave.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ import {
enableMapThumbnailViewer,
updateResource,
manageLinkedResource,
setSelectedLayer
setSelectedLayer,
setResourcePathParameters
} from '@js/actions/gnresource';
import {
getResourceByPk,
Expand Down Expand Up @@ -92,6 +93,7 @@ import {
ProcessStatus
} from '@js/utils/ResourceServiceUtils';
import { updateNode, updateSettingsParams } from '@mapstore/framework/actions/layers';
import { setControlProperty } from '@mapstore/framework/actions/controls';
import { layersSelector, getSelectedLayer as getSelectedNode } from '@mapstore/framework/selectors/layers';
import { styleServiceSelector, getUpdatedLayer, selectedStyleSelector } from '@mapstore/framework/selectors/styleeditor';
import LayersAPI from '@mapstore/framework/api/geoserver/Layers';
Expand Down Expand Up @@ -239,9 +241,17 @@ export const gnSaveContent = (action$, store) =>
const sourcepk = get(state, 'router.location.pathname', '').split('/').pop();
return Observable.of(manageLinkedResource({resourceType: contentType, source: sourcepk, target: resource.pk, processType: ProcessTypes.LINK_RESOURCE}));
}
window.location.href = parseDevHostname(resource?.detail_url);
window.location.reload();
return Observable.empty();
return Observable.concat(
Observable.of(
setResourcePathParameters({pk: resource?.pk}),
setControlProperty(ProcessTypes.COPY_RESOURCE, 'value', undefined)
),
Observable.defer(() => {
window.location.href = parseDevHostname(resource?.detail_url);
window.location.reload();
return Observable.empty();
})
);
}
const selectedLayer = getSelectedNode(state);
const currentStyle = selectedLayer?.availableStyles?.find(({ name }) => selectedLayer?.style?.includes(name));
Expand Down
Loading