Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b1362ef
INT-1160: Adding UI for edit/delete top level element
durran Jun 13, 2016
f5d5185
INT-1160: Handling embedded elements
durran Jun 13, 2016
dfa741c
INT-1160: Bringing in expandable editables
durran Jun 13, 2016
dc7b007
INT-1160: Split rename and edit actions
durran Jun 13, 2016
3ea2a12
INT-1160: Adding static footer
durran Jun 13, 2016
d2ea4b4
INT-1160: Element can be removed or reverted
durran Jun 14, 2016
795fa92
INT-1160: Expand editable elements
durran Jun 14, 2016
a344076
INT-1160: Switch to icons for revert/remove
durran Jun 14, 2016
9614e8c
INT-1160: Cleaning up styles with hover
durran Jun 16, 2016
142db80
INT-1160: Don't allow _id edits
durran Jun 16, 2016
986986c
INT-1160: Auto set array indexes on add
durran Jun 16, 2016
39fc668
INT-1160: Focus on newly added elements
durran Jun 16, 2016
6c1ea6f
INT-1160: Remove added elements
durran Jun 16, 2016
c01e900
INT-1160: footer has events
durran Jun 17, 2016
364616f
INT-1160: Adding type dropdowns
durran Jun 19, 2016
2166b93
INT-1160: Move types into own component
durran Jun 20, 2016
1eb2194
INT-1160: Listen in the types component
durran Jun 20, 2016
4c2adff
quick initial style pass
marcgurney Jun 20, 2016
433860b
INT-1160: Updating key events
durran Jun 20, 2016
0543e80
INT-1160: Fixing hover styles not in edit mode
durran Jun 20, 2016
803774c
CSS fix for clipped dropdowns, may have side effects
marcgurney Jun 20, 2016
f5143ca
INT-1160: Hooking in data service
durran Jun 20, 2016
7bfa707
INT-1160: Hooking in find one and replace
durran Jun 21, 2016
ff40ae5
INT-1160: Hadron document v0.10.0
durran Jun 21, 2016
82431a7
INT-1160: Fixing oid rendering in edit mode
durran Jun 21, 2016
c7bd940
INT-1160: Refactoring stores
durran Jun 22, 2016
a94bd2a
INT-1160: Remove singleton update store
durran Jun 22, 2016
c518d89
INT-1160: Delete a document, no parent update
durran Jun 22, 2016
8f47190
INT-1160: Split actions into their own component
durran Jun 22, 2016
8682708
INT-1160: Rename footer component
durran Jun 22, 2016
e117b1d
INT-1160: Splitting up document list global stores
durran Jun 22, 2016
6f794cd
INT-1160: Finish delete document
durran Jun 22, 2016
33665ca
INT-1160: Refactor edit and delete buttons
durran Jun 22, 2016
106d431
INT-1160: Updating footer buttons and styles
durran Jun 22, 2016
cf9163d
INT-1160: Add hotspot
durran Jun 22, 2016
ebb5fef
CRUD style tuning
marcgurney Jun 22, 2016
1774071
INT-1160: Fix min key, max key, binary display
durran Jun 23, 2016
2881fae
INT-1160: Handle all types in editable list
durran Jun 23, 2016
2c25b9e
INT-1160: Adding base insert modal
durran Jun 23, 2016
763b89f
INT-1160: Open insert document modal with clone
durran Jun 23, 2016
e1b439d
INT-1160: Styling insert button
durran Jun 23, 2016
4f044ac
INT-1160: Shift elements on clone
durran Jun 23, 2016
42007de
INT-1160: Handle events in insert dialog
durran Jun 23, 2016
eacc120
INT-1160: New documents are in added state
durran Jun 23, 2016
6d62b90
INT-1160: Documents are inserting
durran Jun 23, 2016
31e8c0b
some style overrides to fix alignment in json view of explain tab
marcgurney Jun 24, 2016
743b02e
INT-1160: Smarter skip/limit on document list
durran Jun 24, 2016
296f1c8
INT-1160: Styling on error, fix nextSkip on delete
durran Jun 24, 2016
b036430
INT-1160: Fix added style on converted elements
durran Jun 24, 2016
0cd83e1
INT-1160: CRUD goes behind feature flag
durran Jun 24, 2016
90768a1
INT-1160: Validate duplicate keys
durran Jun 24, 2016
2a26eac
INT-1160: Add insert new document
durran Jun 24, 2016
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
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@
"electron-squirrel-startup": "^0.1.4",
"font-awesome": "https://github.com/FortAwesome/Font-Awesome/archive/v4.4.0.tar.gz",
"get-object-path": "azer/get-object-path#74eb42de0cfd02c14ffdd18552f295aba723d394",
"hadron-action": "^0.0.2",
"hadron-action": "^0.0.4",
"hadron-auto-update-manager": "^0.0.12",
"hadron-compile-cache": "^0.1.0",
"hadron-component-registry": "^0.2.0",
"hadron-component-registry": "^0.3.0",
"hadron-document": "^0.12.0",
"hadron-ipc": "^0.0.7",
"hadron-module-cache": "^0.0.3",
"hadron-package-manager": "0.1.0",
"hadron-reflux-store": "^0.0.2",
"hadron-type-checker": "^0.3.0",
"highlight.js": "^8.9.1",
"jquery": "^2.1.4",
"kerberos": "mongodb-js/kerberos#bc619b1b9213eb4cdae786cf3fb916fc7be66758",
Expand All @@ -120,8 +122,8 @@
"marky-mark": "^1.2.1",
"moment": "^2.10.6",
"mongodb-collection-model": "^0.2.3",
"mongodb-connection-model": "^4.2.0",
"mongodb-data-service": "^0.2.1",
"mongodb-connection-model": "^4.3.0",
"mongodb-data-service": "^0.3.0",
"mongodb-database-model": "^0.1.2",
"mongodb-explain-plan-model": "^0.2.0",
"mongodb-extended-json": "^1.6.0",
Expand All @@ -137,6 +139,7 @@
"qs": "^5.2.0",
"raf": "^3.1.0",
"react": "^0.14.8",
"react-bootstrap": "0.29.5",
"react-dom": "^0.14.8",
"semver": "^5.1.0",
"storage-mixin": "^0.6.2",
Expand Down
3 changes: 2 additions & 1 deletion src/app/documents/document-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ var DocumentListView = View.extend({
Action.filterChanged(app.queryOptions.query.serialize());
},
render: function() {
ReactDOM.render(React.createElement(this.documentList), this.el.parentNode);
var container = this.el.parentNode.parentNode.parentNode;
ReactDOM.render(React.createElement(this.documentList), container);
return this;
},
reset: function() {
Expand Down
29 changes: 21 additions & 8 deletions src/app/documents/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.truncate-text-mixin() {
overflow-x: hidden;
// overflow-x: hidden; // commenting out to make the dropdowns work
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
Expand Down Expand Up @@ -31,6 +31,7 @@ ol.document-list {
}

li.document-list-item {
position: relative;
font-family: @font-family-monospace;
font-size: 11px;
padding-bottom: 10px;
Expand Down Expand Up @@ -97,6 +98,15 @@ ol.document-list {
}
}

.document-property.code > .document-property-value {
&::before {
content: "Code('";
}
&::after {
content: "')";
}
}

li.document-property.array, li.document-property.object {
display: block;
margin-left: -16px;
Expand All @@ -114,8 +124,8 @@ ol.document-list {
display: inline-block;
width: 12px;
height: 1em;
margin-left: 2px;
margin-right: 10px;
margin-left: -8px !important; // remove important hack later
margin-right: 4px;
.caret-right;
}

Expand All @@ -130,18 +140,21 @@ ol.document-list {
}

ol.document-property-body {
// margin-left: 21px;
padding-left: 36px;
// border-left: 1px dotted @gray6;
padding-left: 0;
display: none;

.document-property-key,
.editable-key {
margin-left: 16px;
}
}
&.expanded {
> .document-property-header {
> .caret {
.caret-down;
vertical-align: bottom;
margin-left: 4px;
margin-right: 8px;
margin-left: -10px !important; // remove important hack later
margin-right: 2px;
}
}
> ol.document-property-body {
Expand Down
23 changes: 22 additions & 1 deletion src/app/explain-plan/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
.explain-container {

// hacks for json view on explain tab
ol.document-list li.document-list-item ol.document-property-body li.document-property.array ol.document-property-body .document-property-key,
ol.document-list li.document-list-item ol.document-property-body li.document-property.object ol.document-property-body .document-property-key {
margin-left: 0;
}

ol.document-list li.document-list-item ol.document-property-body li.document-property.array.expanded > ol.document-property-body,
ol.document-list li.document-list-item ol.document-property-body li.document-property.object.expanded > ol.document-property-body {
margin-left: 16px;
}

ol.document-list li.document-list-item ol.document-property-body li.document-property.array.expanded,
ol.document-list li.document-list-item ol.document-property-body li.document-property.object.expanded {
margin-left: 0;
}

ol.document-list li.document-list-item ol.document-property-body li.document-property.array,
ol.document-list li.document-list-item ol.document-property-body li.document-property.object {
margin-left: 0;
}
// end hacks

.summary-container {
background: @pw;
padding: 12px;
Expand Down Expand Up @@ -59,7 +81,6 @@
float: left;
margin-right: 24px;
}

}

i.link {
Expand Down
2 changes: 2 additions & 0 deletions src/app/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
@import "../auto-update/index.less";
@import "../help/index.less";
@import "metrics/index.less";

@import "../internal-packages/crud/styles/crud.less";
8 changes: 8 additions & 0 deletions src/app/models/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ var Preferences = Model.extend(storageMixin, {
required: true,
default: false
},
/**
* Allow single document CRUD.
*/
singleDocumentCrud: {
type: 'boolean',
required: true,
default: false
},
/**
* Switches to enable/disable various authentication / ssl types
*
Expand Down
1 change: 0 additions & 1 deletion src/app/styles/caret.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
}
.caret-down {
Expand Down
4 changes: 4 additions & 0 deletions src/app/styles/palette.less
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
@pw: #fff;
@cautionOrange: @alertOrange;
@errorBackground: #fdd0d1;
@greenBg: #e9f2e3;

/* Text Colors */
/* default text color is @gray1 */
Expand Down Expand Up @@ -76,7 +77,10 @@

/* Alert Colors */
@alertOrange: #fbb129;
@alertOrangeBg: #fff4dc;
@alertOrangeBorder: #a06c29;
@alertRed: #ef4c4c;
@alertRedBg: #feeded;
@alertBlue: #43b1e5;

/* Semantic Colors */
Expand Down
11 changes: 11 additions & 0 deletions src/internal-packages/crud/lib/actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

const Reflux = require('reflux');

const Actions = Reflux.createActions([
'documentRemoved',
'openInsertDocumentDialog',
'insertDocument'
]);

module.exports = Actions;
71 changes: 71 additions & 0 deletions src/internal-packages/crud/lib/component/binary-value.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
'use strict';

const React = require('react');
const truncate = require('hadron-component-registry').truncate;

/**
* Base 64 constant.
*/
const BASE_64 = 'base64';

/**
* The new UUID type.
*/
const UUID = 4;

/**
* The old UUID type.
*/
const UUID_OLD = 3;

/**
* The document value class.
*/
const VALUE_CLASS = 'document-property-value';

/**
* Binary value component.
*/
class BinaryValue extends React.Component {

/**
* The component constructor.
*
* @param {Object} props - The properties.
*/
constructor(props) {
super(props);
this.value = props.element.currentValue;
}

/**
* Render a single binary value.
*
* @returns {React.Component} The element component.
*/
render() {
return (
<div className={VALUE_CLASS}>
{this.renderValue()}
</div>
);
}

/**
* Render the value.
*
* @returns {Component} The component.
*/
renderValue() {
var type = this.value.sub_type;
var buffer = this.value.buffer;
if (type === UUID || type === UUID_OLD) {
return `Binary('${truncate(buffer.toString())}')`;
}
return `Binary('${truncate(buffer.toString(BASE_64))}')`;
}
}

BinaryValue.displayName = 'BinaryValue';

module.exports = BinaryValue;
38 changes: 38 additions & 0 deletions src/internal-packages/crud/lib/component/cancel-edit-button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

const React = require('react');

/**
* Component for the cancel button.
*/
class CancelEditButton extends React.Component {

/**
* The component constructor.
*
* @param {Object} props - The properties.
*/
constructor(props) {
super(props);
}

/**
* Render the button.
*
* @returns {Component} The button component.
*/
render() {
return (
<button
className='btn btn-link btn-xs cancel'
type='button'
onClick={this.props.handler}>
Cancel
</button>
);
}
}

CancelEditButton.displayName = 'CancelEditButton';

module.exports = CancelEditButton;
38 changes: 38 additions & 0 deletions src/internal-packages/crud/lib/component/cancel-insert-button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

const React = require('react');

/**
* Component for the cancel button.
*/
class CancelInsertButton extends React.Component {

/**
* The component constructor.
*
* @param {Object} props - The properties.
*/
constructor(props) {
super(props);
}

/**
* Render the button.
*
* @returns {Component} The button component.
*/
render() {
return (
<button
className='btn btn-default btn-xs cancel'
type='button'
onClick={this.props.handler}>
Cancel
</button>
);
}
}

CancelInsertButton.displayName = 'CancelInsertButton';

module.exports = CancelInsertButton;
35 changes: 35 additions & 0 deletions src/internal-packages/crud/lib/component/clone-document-button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use strict';

const React = require('react');

/**
* Component for the clone document button.
*/
class CloneDocumentButton extends React.Component {

/**
* The component constructor.
*
* @param {Object} props - The properties.
*/
constructor(props) {
super(props);
}

/**
* Render the button.
*
* @returns {Component} The button component.
*/
render() {
return (
<button type='button' onClick={this.props.handler} title='Clone Document'>
<i className="fa fa-clone" aria-hidden="true"></i>
</button>
);
}
}

CloneDocumentButton.displayName = 'CloneDocumentButton';

module.exports = CloneDocumentButton;
Loading