diff --git a/.gitignore b/.gitignore
index 5b09eeacb6b..294e3dd4443 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ report.json
.compiled-sources/
src/app/compiled-less/
expansions.yml
+.nvmrc
diff --git a/package.json b/package.json
index d11620ed93c..96be0a1e83e 100644
--- a/package.json
+++ b/package.json
@@ -102,9 +102,9 @@
"get-object-path": "azer/get-object-path#74eb42de0cfd02c14ffdd18552f295aba723d394",
"hadron-action": "^0.0.4",
"hadron-auto-update-manager": "^0.0.12",
- "hadron-compile-cache": "^0.1.0",
+ "hadron-compile-cache": "^0.2.0",
"hadron-component-registry": "^0.4.0",
- "hadron-document": "^0.13.0",
+ "hadron-document": "^0.14.0",
"hadron-ipc": "^0.0.7",
"hadron-module-cache": "^0.0.3",
"hadron-package-manager": "0.1.0",
diff --git a/src/help/entries/cloning-a-single-document.md b/src/help/entries/cloning-a-single-document.md
new file mode 100644
index 00000000000..3bb05a04248
--- /dev/null
+++ b/src/help/entries/cloning-a-single-document.md
@@ -0,0 +1,14 @@
+---
+title: Cloning a Single Document
+tags:
+ - crud
+related:
+ - inserting-a-single-document
+section: CRUD
+---
+
+A single document can be cloned by clicking on the clone icon
+ on the right
+side of the document in the document list. The Insert Document
+modal will appear with all elements in the document cloned with
+the exception of the `_id` element.
diff --git a/src/help/entries/deleting-a-single-document.md b/src/help/entries/deleting-a-single-document.md
new file mode 100644
index 00000000000..d29fab85f14
--- /dev/null
+++ b/src/help/entries/deleting-a-single-document.md
@@ -0,0 +1,12 @@
+---
+title: Deleting a Single Document
+tags:
+ - crud
+section: CRUD
+---
+
+A single document can be deleted by clicking on the delete icon
+ on the right
+side of the document in the document list. Clicking on this button puts
+the document into a pending delete mode, but the delete command will
+not be sent to the server until the user confirms the edits by clicking 'Delete'.
diff --git a/src/help/entries/editing-a-single-document.md b/src/help/entries/editing-a-single-document.md
new file mode 100644
index 00000000000..a5052a36c44
--- /dev/null
+++ b/src/help/entries/editing-a-single-document.md
@@ -0,0 +1,53 @@
+---
+title: Editing a Single Document
+tags:
+ - crud
+section: CRUD
+---
+
+A single document can be edited by clicking on the edit icon
+ on the right
+side of the document in the document list. Clicking on this button puts
+the document into edit mode, but changes will not be sent to the server
+until the user confirms the edits by clicking 'Update'.
+
+In edit mode, the document panel behaves similar to the CSS editor in
+most modern web browers' development tools.
+
+### Editing an Element
+
+Clicking on an element key or value allows the user to change the key name
+or the value of the element. The element's type can also be changed by
+selecting a new type from the dropdown on the right side. Only types that
+the value can currently be cast to will be visible in the list. Duplicate
+key names will cause the key field to be highlighted in red.
+
+### Adding an Element
+
+A new element can be added to the document or any embedded document by
+either clicking on the right side of the element or tabbing off the last
+element's value field if the element is the last element in the document
+or sub document. Clicking to the right of an element will also remove any
+subsequent extra empty elements.
+
+### Deleting an Element
+
+An element can be deleted by clicking on the
+icon to the left of the element's line number.
+
+### Reverting a Change
+
+A change to an element can be reverted by clicking the revert icon
+
+to the left of the element's line number.
+
+### Persisting Changes
+
+The changes to a document may be persisted by clicking on the 'Update'
+button in the footer of the document panel. Clicking this button will
+execute a `$findAndModify` on the server and update the document in the
+list.
+
+### Canceling Changes
+
+To exit edit mode and cancel all pending changes, click the 'Cancel' button.
diff --git a/src/help/entries/inserting-a-single-document.md b/src/help/entries/inserting-a-single-document.md
new file mode 100644
index 00000000000..08a3d8901da
--- /dev/null
+++ b/src/help/entries/inserting-a-single-document.md
@@ -0,0 +1,13 @@
+---
+title: Inserting a Single Document
+tags:
+ - crud
+related:
+ - editing-a-single-document
+section: CRUD
+---
+
+A single document can be inserted by clicking on the 'Insert' button at
+the top of the document list. An insert modal will open and the user
+may edit the new document using the same behaviour provided by document
+editing.
diff --git a/src/internal-packages/crud/lib/component/document-actions.jsx b/src/internal-packages/crud/lib/component/document-actions.jsx
index 59d692395db..c2887717850 100644
--- a/src/internal-packages/crud/lib/component/document-actions.jsx
+++ b/src/internal-packages/crud/lib/component/document-actions.jsx
@@ -1,14 +1,8 @@
'use strict';
const React = require('react');
-const app = require('ampersand-app');
const IconButton = require('./icon-button');
-/**
- * The feature flag.
- */
-const FEATURE = 'singleDocumentCrud';
-
/**
* Component for actions on the document.
*/
@@ -29,26 +23,21 @@ class DocumentActions extends React.Component {
* @returns {Component} The actions component.
*/
render() {
- if (app.isFeatureEnabled(FEATURE)) {
- return (
-
-
-
-
-
- );
- }
return (
-
+
+
+
+
+
);
}
}
diff --git a/src/internal-packages/crud/lib/component/document.jsx b/src/internal-packages/crud/lib/component/document.jsx
index 5675839f714..b572044f624 100644
--- a/src/internal-packages/crud/lib/component/document.jsx
+++ b/src/internal-packages/crud/lib/component/document.jsx
@@ -1,6 +1,5 @@
'use strict';
-const _ = require('lodash');
const app = require('ampersand-app');
const React = require('react');
const Reflux = require('reflux');
@@ -270,14 +269,15 @@ class Document extends React.Component {
* @returns {Array} The editable elements.
*/
editableElements() {
- var components = _.map(this.state.doc.elements, (element) => {
- return (
-
- );
- });
+ var components = [];
+ for (let element of this.state.doc.elements) {
+ components.push()
+ }
+ // Add the hotspot to the end. In the case of insert, we need to guard against
+ // No elements being present.
var lastComponent = components[components.length - 1];
- var lastElement = lastComponent ? lastComponent.props.element : null;
- components.push();
+ var lastElement = lastComponent ? lastComponent.props.element : this.state.doc;
+ components.push();
return components;
}
diff --git a/src/internal-packages/crud/lib/component/editable-element.jsx b/src/internal-packages/crud/lib/component/editable-element.jsx
index fe5b0602319..82a11cc31a5 100644
--- a/src/internal-packages/crud/lib/component/editable-element.jsx
+++ b/src/internal-packages/crud/lib/component/editable-element.jsx
@@ -116,9 +116,10 @@ class EditableElement extends React.Component {