mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Merge branch 'feature/upload' of github.com:strapi/strapi into feature/upload
This commit is contained in:
commit
670f1d8434
@ -5,6 +5,9 @@
|
||||
"name": "<%= id %>",
|
||||
"description": "<%= description %>"
|
||||
},
|
||||
"options": {
|
||||
"timestamps": true
|
||||
},
|
||||
"attributes": {
|
||||
<%= attributes %>
|
||||
}
|
||||
|
||||
@ -158,6 +158,8 @@ module.exports = function (strapi) {
|
||||
});
|
||||
});
|
||||
|
||||
collection.schema.set('timestamps', _.get(definition, 'options.timestamps') === true);
|
||||
|
||||
collection.schema.options.toObject = collection.schema.options.toJSON = {
|
||||
virtuals: true,
|
||||
transform: function (doc, returned, opts) {
|
||||
|
||||
@ -126,7 +126,8 @@ class Edit extends React.PureComponent {
|
||||
|
||||
fileRelationAllowMultipleUpload = (relationName) => has(this.props.schema, ['relations', relationName, 'collection']);
|
||||
|
||||
orderAttributes = (displayedFields) => Object.keys(displayedFields).sort(name => Object.keys(this.getUploadRelations(this.props)).includes(name));
|
||||
// orderAttributes = (displayedFields) => Object.keys(displayedFields).sort(name => Object.keys(this.getUploadRelations(this.props)).includes(name));
|
||||
orderAttributes = (displayedFields) => Object.keys(displayedFields);
|
||||
|
||||
render(){
|
||||
return (
|
||||
|
||||
@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
||||
import cn from 'classnames';
|
||||
import moment from 'moment';
|
||||
|
||||
import FileIcon from 'components/FileIcon';
|
||||
import IcoContainer from 'components/IcoContainer';
|
||||
@ -100,6 +101,12 @@ class Li extends React.Component {
|
||||
<FileIcon fileType={item.ext} />
|
||||
</div>
|
||||
{['hash', 'name', 'updatedAt', 'size', 'relatedTo', ''].map((value, key) => {
|
||||
if (value === 'updatedAt') {
|
||||
return (
|
||||
<div key={key} className={styles.truncate}>{moment(item[value]).format('YYYY/MM/DD - HH:mm')}</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (value === 'size') {
|
||||
const unit = this.getUnit(item[value]);
|
||||
|
||||
|
||||
@ -4,6 +4,9 @@
|
||||
"name": "file",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
"timestamps": true
|
||||
},
|
||||
"attributes": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
||||
@ -48,4 +48,4 @@
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,9 @@
|
||||
"name": "user",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
"timestamps": true
|
||||
},
|
||||
"attributes": {
|
||||
"username": {
|
||||
"type": "string",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user