Adding links pointing to the new user profile page (#1704)

* Adding links pointing to the new user profile page

* Raising coverage

* Fixing tests
This commit is contained in:
Maxime Beauchemin
2016-12-01 15:21:18 -08:00
committed by GitHub
parent 50da4f8c07
commit 7eef46e941
7 changed files with 79 additions and 34 deletions

View File

@@ -19,6 +19,7 @@ export default class Favorites extends React.PureComponent {
renderSliceTable() {
const mutator = (data) => data.map(slice => ({
slice: <a href={slice.url}>{slice.title}</a>,
creator: <a href={slice.creator_url}>{slice.creator}</a>,
favorited: moment.utc(slice.dttm).fromNow(),
_favorited: slice.dttm,
}));
@@ -26,7 +27,7 @@ export default class Favorites extends React.PureComponent {
<TableLoader
dataEndpoint={`/superset/fave_slices/${this.props.user.userId}/`}
className="table table-condensed"
columns={['slice', 'favorited']}
columns={['slice', 'creator', 'favorited']}
mutator={mutator}
noDataText="No favorite slices yet, go click on stars!"
sortable
@@ -36,6 +37,7 @@ export default class Favorites extends React.PureComponent {
renderDashboardTable() {
const mutator = (data) => data.map(dash => ({
dashboard: <a href={dash.url}>{dash.title}</a>,
creator: <a href={dash.creator_url}>{dash.creator}</a>,
favorited: moment.utc(dash.dttm).fromNow(),
}));
return (
@@ -44,7 +46,7 @@ export default class Favorites extends React.PureComponent {
mutator={mutator}
dataEndpoint={`/superset/fave_dashboards/${this.props.user.userId}/`}
noDataText="No favorite dashboards yet, go click on stars!"
columns={['dashboard', 'favorited']}
columns={['dashboard', 'creator', 'favorited']}
sortable
/>
);

View File

@@ -15,7 +15,6 @@ const profileViewContainer = document.getElementById('app');
const bootstrap = JSON.parse(profileViewContainer.getAttribute('data-bootstrap'));
const user = bootstrap.user;
ReactDOM.render(
<App user={user} />,
profileViewContainer