Skip to content
Snippets Groups Projects
Unverified Commit d9483053 authored by Tom Robinson's avatar Tom Robinson
Browse files

Merge branch 'master' of github.com:metabase/metabase into update-frontend-deps-and-devtool

parents 4fb502aa f7f59593
No related branches found
No related tags found
No related merge requests found
import { createAction, createThunkAction, handleActions, combineReducers } from "metabase/lib/redux";
import { reset } from 'redux-form';
import { goBack } from "react-router-redux";
import { push } from "react-router-redux";
import Urls from "metabase/lib/urls";
import _ from "underscore";
......@@ -36,7 +37,7 @@ export const saveCollection = createThunkAction(SAVE_COLLECTION, (collection) =>
if (response.id != null) {
dispatch(reset("collection"));
}
dispatch(goBack())
dispatch(push(Urls.collection(response)));
return response;
} catch (e) {
// redux-form expects an object with either { field: error } or { _error: error }
......
......@@ -29,9 +29,11 @@ class CollectionButton extends Component {
}
render () {
const { id, name, color, slug, isAdmin, push } = this.props;
const { id, name, color, slug, isAdmin } = this.props;
return (
<div
<Link
to={`/questions/collections/${slug}`}
className="no-decoration"
onMouseEnter={() => this.setState({ hovered: true })}
onMouseLeave={() => this.setState({ hovered: false })}
>
......@@ -43,7 +45,6 @@ class CollectionButton extends Component {
borderRadius: 10,
backgroundColor: this.state.hovered ? color : '#fafafa'
}}
onClick={() => push(`/questions/collections/${slug}`)}
>
{ isAdmin &&
<div className="absolute top right mt2 mr2 hover-child">
......@@ -61,7 +62,7 @@ class CollectionButton extends Component {
/>
<h3>{ name }</h3>
</div>
</div>
</Link>
)
}
}
......
......@@ -55,6 +55,7 @@ export default class CollectionPage extends Component {
</div>
<div className="mt4">
<EntityList
defaultEmptyState="No questions have been added to this collection yet."
entityType="cards"
entityQuery={{ f: "all", collection: params.collectionSlug, ...location.query }}
// use replace when changing sections so back button still takes you back to collections page
......
......@@ -45,7 +45,7 @@ const referenceSections = {
message: "Metrics will appear here once your admins have created some",
image: "/app/img/metrics-list",
adminAction: "Learn how to create metrics",
adminLink: "http://www.metabase.com/docs/latest/administration-guide/05-segments-and-metrics.html"
adminLink: "http://www.metabase.com/docs/latest/administration-guide/06-segments-and-metrics.html"
},
breadcrumb: "Metrics",
// mapping of propname to args of dispatch function
......@@ -65,7 +65,7 @@ const referenceSections = {
message: "Segments will appear here once your admins have created some",
image: "/app/img/segments-list",
adminAction: "Learn how to create segments",
adminLink: "http://www.metabase.com/docs/latest/administration-guide/05-segments-and-metrics.html"
adminLink: "http://www.metabase.com/docs/latest/administration-guide/06-segments-and-metrics.html"
},
breadcrumb: "Segments",
fetch: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment