Skip to content

Commit acc61b4

Browse files
committed
INT-1844/INT-1841: Namespace documents with collection name (#483)
* INT-1844: Namespace documents with collection name * INT-1844/INT-1841: Convert object id to json
1 parent bcfc228 commit acc61b4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/internal-packages/crud/lib/component/document-list.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,21 @@ class DocumentList extends React.Component {
204204
*/
205205
renderDocuments(docs) {
206206
return _.map(docs, (doc) => {
207-
return (<Document doc={doc} key={doc._id} />);
207+
return (<Document doc={doc} key={this._key(doc)} editable />);
208208
});
209209
}
210210

211+
/**
212+
* Get the key for a doc.
213+
*
214+
* @param {Document} doc - The document.
215+
*
216+
* @returns {String} The unique key.
217+
*/
218+
_key(doc) {
219+
return `${NamespaceStore.ns}_${JSON.stringify(doc._id)}`
220+
}
221+
211222
/**
212223
* Determine if the component should update.
213224
*

0 commit comments

Comments
 (0)