Skip to content
Snippets Groups Projects
Commit a53e3783 authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Merge pull request #4069 from metabase/collections-fixes-2

Collections fixes 2
parents e784304a 701b0df8
Branches
Tags
No related merge requests found
......@@ -116,13 +116,13 @@ export class FullPageModal extends Component {
this._modalElement.className = "Modal--full";
document.querySelector('body').appendChild(this._modalElement);
this.componentDidUpdate();
// save the scroll position, scroll to the top left, and disable scrolling
this._scrollX = window.scrollX;
this._scrollY = window.scrollY;
window.scrollTo(0,0);
document.body.style.overflow = "hidden";
this.componentDidUpdate();
}
componentDidUpdate() {
......
import { createAction, createThunkAction, handleActions, combineReducers } from "metabase/lib/redux";
import { reset } from 'redux-form';
import { push } from "react-router-redux";
import { replace } from "react-router-redux";
import Urls from "metabase/lib/urls";
import _ from "underscore";
......@@ -37,7 +37,8 @@ export const saveCollection = createThunkAction(SAVE_COLLECTION, (collection) =>
if (response.id != null) {
dispatch(reset("collection"));
}
dispatch(push(Urls.collection(response)));
// use `replace` so form url doesn't appear in history
dispatch(replace(Urls.collection(response)));
return response;
} catch (e) {
// redux-form expects an object with either { field: error } or { _error: error }
......
......@@ -22,7 +22,7 @@ const mapDispatchToProps = ({
goBack,
goToQuestions: () => push(`/questions`),
editCollection: (id) => push(`/collections/${id}`),
editPermissions: (id) => push(`/collections/permissions?collection=${id}`),
editPermissions: (id) => push(`/collections/permissions?collectionId=${id}`),
loadCollections,
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment