1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 17:02:47 +00:00

update draft&review dispaly (#2505)

* replace draft.id with draft_name

* add updateDraftsList function

* Repair operation display

* update review dispaly

* refactor code
This commit is contained in:
C_Q
2018-11-08 10:36:41 +08:00
committed by Daniel Pan
parent 9f8b522fac
commit 8dcf88c32a
7 changed files with 95 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { siteRoot, lang } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import MenuControl from '../menu-control';
import moment from 'moment';
@@ -66,14 +67,9 @@ class DraftListItem extends React.Component {
window.open(url);
}
getFileName(filePath) {
let lastIndex = filePath.lastIndexOf('/');
return filePath.slice(lastIndex+1);
}
render() {
let draft = this.props.draft;
let fileName = this.getFileName(draft.draft_file_path);
let fileName = Utils.getFileName(draft.draft_file_path);
let localTime = moment.utc(draft.updated_at).toDate();
localTime = moment(localTime).fromNow();
return (