From 495cd45dd9250d2969c7b9600656a2cb9d705da0 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Fri, 11 Nov 2016 23:17:57 +0100 Subject: [PATCH] COMPASS-134: Backport: Use uuids for document list keys (#583) --- .../crud/lib/component/document-list.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/internal-packages/crud/lib/component/document-list.jsx b/src/internal-packages/crud/lib/component/document-list.jsx index 095c4dd0f25..75144812dd9 100644 --- a/src/internal-packages/crud/lib/component/document-list.jsx +++ b/src/internal-packages/crud/lib/component/document-list.jsx @@ -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; @@ -191,12 +192,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(); } /** @@ -222,7 +221,7 @@ class DocumentList extends React.Component { renderDocuments(docs) { return _.map(docs, (doc) => { return ( -
  • +
  • );