mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
* Updated welcome landing page * fixed test and linting * linting * addressing comments * fix test * fix test * remove unneeded var * add magic comments
35 lines
843 B
JavaScript
35 lines
843 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import moment from 'moment';
|
|
|
|
import TableLoader from './TableLoader';
|
|
|
|
const propTypes = {
|
|
user: PropTypes.object,
|
|
};
|
|
|
|
export default class RecentActivity extends React.PureComponent {
|
|
render() {
|
|
const rowLimit = 50;
|
|
const mutator = function (data) {
|
|
return data.map(row => ({
|
|
name: <a href={row.item_url}>{row.item_title}</a>,
|
|
type: row.action,
|
|
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}/?limit=${rowLimit}`}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
RecentActivity.propTypes = propTypes;
|