mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
User profile pages (favorites, created content, recent activity, security & access) (#1615)
* Super * User profile page * Fixing python style * Python unit tests * Touchups and js tests * Addressing comments
This commit is contained in:
committed by
GitHub
parent
5ae98bc7c9
commit
7e1852ee88
@@ -0,0 +1,44 @@
|
||||
import React from 'react';
|
||||
import TableLoader from './TableLoader';
|
||||
import moment from 'moment';
|
||||
import $ from 'jquery';
|
||||
|
||||
const propTypes = {
|
||||
user: React.PropTypes.object,
|
||||
};
|
||||
|
||||
export default class RecentActivity extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
recentActions: [],
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
$.get(`/superset/recent_activity/${this.props.user.userId}/`, (data) => {
|
||||
this.setState({ recentActions: data });
|
||||
});
|
||||
}
|
||||
render() {
|
||||
const mutator = function (data) {
|
||||
return data.map(row => ({
|
||||
action: row.action,
|
||||
item: <a href={row.item_url}>{row.item_title}</a>,
|
||||
time: moment.utc(row.time).fromNow(),
|
||||
_time: row.time,
|
||||
}));
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<TableLoader
|
||||
className="table table-condensed"
|
||||
mutator={mutator}
|
||||
sortable
|
||||
dataEndpoint={`/superset/recent_activity/${this.props.user.userId}/`}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
RecentActivity.propTypes = propTypes;
|
||||
Reference in New Issue
Block a user