Skip to content

Commit 9a49140

Browse files
committed
COMPASS-1738: Use ObjectId in types list
1 parent 27916b8 commit 9a49140

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@
161161
"hadron-app-registry": "^6.0.0",
162162
"hadron-auto-update-manager": "^0.0.12",
163163
"hadron-compile-cache": "^1.0.1",
164-
"hadron-document": "^2.3.3",
164+
"hadron-document": "^3.0.0",
165165
"hadron-ipc": "^0.0.7",
166166
"hadron-module-cache": "^0.0.3",
167167
"hadron-package-manager": "^4.0.0",
168168
"hadron-react-bson": "^1.4.0",
169169
"hadron-react-buttons": "^1.5.0",
170170
"hadron-react-components": "^1.8.0",
171171
"hadron-style-manager": "^0.1.0",
172-
"hadron-type-checker": "^2.1.0",
172+
"hadron-type-checker": "^3.0.0",
173173
"highlight.js": "^8.9.1",
174174
"jquery": "^2.1.4",
175175
"keytar": "mongodb-js/node-keytar#fdef09013f576b7a257ad768939e827882bccef5",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const _ = require('lodash');
22
const React = require('react');
33
const uuid = require('uuid');
4-
const ObjectID = require('bson').ObjectID;
4+
const ObjectId = require('bson').ObjectId;
55
const Action = require('../actions');
66
const { StatusRow } = require('hadron-react-components');
77
const ResetDocumentListStore = require('../store/reset-document-list-store');
@@ -152,7 +152,7 @@ class DocumentList extends React.Component {
152152
handleRemove(id) {
153153
const index = _.findIndex(this.state.docs, (component) => {
154154
const _id = component.props.children.props.doc._id;
155-
if (id instanceof ObjectID) {
155+
if (id instanceof ObjectId) {
156156
return id.equals(_id);
157157
}
158158
return _id === id;
@@ -181,7 +181,7 @@ class DocumentList extends React.Component {
181181
* Handle opening of the insert dialog.
182182
*/
183183
handleOpenInsert() {
184-
Actions.openInsertDocumentDialog({ _id: new ObjectID(), '': '' }, false);
184+
Actions.openInsertDocumentDialog({ _id: new ObjectId(), '': '' }, false);
185185
}
186186

187187
/**

src/internal-packages/crud/lib/component/editor/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const DoubleEditor = require('./double');
55
const DateEditor = require('./date');
66
const NullEditor = require('./null');
77
const UndefinedEditor = require('./undefined');
8-
const ObjectIDEditor = require('./objectid');
8+
const ObjectIdEditor = require('./objectid');
99

1010
const init = (element) => {
1111
return {
@@ -16,7 +16,7 @@ const init = (element) => {
1616
'Int32': new Int32Editor(element),
1717
'Null': new NullEditor(element),
1818
'Undefined': new UndefinedEditor(element),
19-
'ObjectID': new ObjectIDEditor(element)
19+
'ObjectId': new ObjectIdEditor(element)
2020
};
2121
};
2222

@@ -28,4 +28,4 @@ module.exports.DoubleEditor = DoubleEditor;
2828
module.exports.Int32Editor = Int32Editor;
2929
module.exports.NullEditor = NullEditor;
3030
module.exports.UndefinedEditor = UndefinedEditor;
31-
module.exports.ObjectIDEditor = ObjectIDEditor;
31+
module.exports.ObjectIdEditor = ObjectIdEditor;

src/internal-packages/crud/lib/component/editor/objectid.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const chars = require('../utils');
55
/**
66
* CRUD editor for object id values.
77
*/
8-
class ObjectIDEditor {
8+
class ObjectIdEditor {
99

1010
/**
1111
* Create the editor with the element.
@@ -22,7 +22,7 @@ class ObjectIDEditor {
2222
*/
2323
complete() {
2424
if (this.element.isCurrentTypeValid()) {
25-
this.element.edit(TypeChecker.cast(this.element.currentValue, 'ObjectID'));
25+
this.element.edit(TypeChecker.cast(this.element.currentValue, 'ObjectId'));
2626
}
2727
}
2828

@@ -33,7 +33,7 @@ class ObjectIDEditor {
3333
*/
3434
edit(value) {
3535
try {
36-
TypeChecker.cast(value, 'ObjectID');
36+
TypeChecker.cast(value, 'ObjectId');
3737
this.element.currentValue = value;
3838
this.element.setValid();
3939
this.element._bubbleUp(Element.Events.Edited);
@@ -70,4 +70,4 @@ class ObjectIDEditor {
7070
}
7171
}
7272

73-
module.exports = ObjectIDEditor;
73+
module.exports = ObjectIdEditor;

0 commit comments

Comments
 (0)