mirror of
https://github.com/strapi/strapi.git
synced 2025-11-19 11:41:49 +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 %>",
|
"name": "<%= id %>",
|
||||||
"description": "<%= description %>"
|
"description": "<%= description %>"
|
||||||
},
|
},
|
||||||
|
"options": {
|
||||||
|
"timestamps": true
|
||||||
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
<%= 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 = {
|
collection.schema.options.toObject = collection.schema.options.toJSON = {
|
||||||
virtuals: true,
|
virtuals: true,
|
||||||
transform: function (doc, returned, opts) {
|
transform: function (doc, returned, opts) {
|
||||||
|
|||||||
@ -126,7 +126,8 @@ class Edit extends React.PureComponent {
|
|||||||
|
|
||||||
fileRelationAllowMultipleUpload = (relationName) => has(this.props.schema, ['relations', relationName, 'collection']);
|
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(){
|
render(){
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
|
|||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
import FileIcon from 'components/FileIcon';
|
import FileIcon from 'components/FileIcon';
|
||||||
import IcoContainer from 'components/IcoContainer';
|
import IcoContainer from 'components/IcoContainer';
|
||||||
@ -100,6 +101,12 @@ class Li extends React.Component {
|
|||||||
<FileIcon fileType={item.ext} />
|
<FileIcon fileType={item.ext} />
|
||||||
</div>
|
</div>
|
||||||
{['hash', 'name', 'updatedAt', 'size', 'relatedTo', ''].map((value, key) => {
|
{['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') {
|
if (value === 'size') {
|
||||||
const unit = this.getUnit(item[value]);
|
const unit = this.getUnit(item[value]);
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,9 @@
|
|||||||
"name": "file",
|
"name": "file",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"options": {
|
||||||
|
"timestamps": true
|
||||||
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@ -48,4 +48,4 @@
|
|||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
@ -4,6 +4,9 @@
|
|||||||
"name": "user",
|
"name": "user",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"options": {
|
||||||
|
"timestamps": true
|
||||||
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"username": {
|
"username": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user