Files
superset2/superset/assets/javascripts/profile/components/RecentActivity.jsx
Hugh A. Miles II 11ea83ecf1 New Landing Page v1.0 (#4463)
* Updated welcome landing page

* fixed test and linting

* linting

* addressing comments

* fix test

* fix test

* remove unneeded var

* add magic comments
2018-02-26 17:02:41 -08:00

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;