Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/internal-packages/crud/lib/component/document-list.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const _ = require('lodash');
const React = require('react');
const uuid = require('node-uuid');
const app = require('ampersand-app');
const Action = require('hadron-action');
const ObjectID = require('bson').ObjectID;
Expand Down Expand Up @@ -192,12 +193,10 @@ class DocumentList extends React.Component {
/**
* Get the key for a doc.
*
* @param {Document} doc - The document.
*
* @returns {String} The unique key.
*/
_key(doc) {
return `${NamespaceStore.ns}_${JSON.stringify(doc._id)}`;
_key() {
return uuid.v4();
}

/**
Expand All @@ -223,7 +222,7 @@ class DocumentList extends React.Component {
renderDocuments(docs) {
return _.map(docs, (doc) => {
return (
<li className="document-list-item" key={this._key(doc)}>
<li className="document-list-item" key={this._key()}>
<Document doc={doc} key={this._key(doc)} editable={this.CollectionStore.isWritable()} />
</li>
);
Expand Down