Skip to content

Commit 6f6c582

Browse files
imlucaskangas
authored andcommitted
INT-1650: Fix TypeError: Property 'ssh_tunnel_port' must be of type number (#441)
* INT-1650: Fix TypeError: Property 'ssh_tunnel_port' must be of type number The form default view is `’’` which is false-y so we were trying to set an empty string as a number. * ⬆️ [email protected] mongodb-js/connection-model#87 - All logic in one place for easier DX and release management - Refactor `connect()` so if you specify ssh tunnel options, it all just works. - New `status` events to enable live updating status bars @rueckstiess would like to implement. - This will be an `npm version major` and subsequent major of data-service. * ⬆️ [email protected] * [email protected] uses standard node.js style event names (cherry picked from commit ac08030)
1 parent b20c2cc commit 6f6c582

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
"marked": "^0.3.5",
122122
"moment": "^2.10.6",
123123
"mongodb-collection-model": "^0.2.3",
124-
"mongodb-connection-model": "^4.3.0",
125-
"mongodb-data-service": "^0.3.0",
124+
"mongodb-connection-model": "^5.0.0",
125+
"mongodb-data-service": "^1.0.0",
126126
"mongodb-database-model": "^0.1.2",
127127
"mongodb-explain-plan-model": "^0.2.0",
128128
"mongodb-extended-json": "^1.6.0",

src/app/connect/connect-form-view.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ var ConnectFormView = FormView.extend({
6868
// fill in all default fields
6969
obj.hostname = obj.hostname.toLowerCase() || 'localhost';
7070
obj.port = parseInt(obj.port || 27017, 10);
71-
if (obj.ssh_tunnel_port) {
72-
obj.ssh_tunnel_port = parseInt(obj.ssh_tunnel_port, 10);
73-
}
71+
obj.ssh_tunnel_port = parseInt(obj.ssh_tunnel_port || 22, 10);
7472

7573
// make a friendly connection name
7674
// this.makeFriendlyName(obj);

src/app/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ app.extend({
398398

399399
var DataService = require('mongodb-data-service');
400400
app.dataService = new DataService(state.connection)
401-
.on(DataService.Events.Readable, state.onClientReady.bind(state))
402-
.on(DataService.Events.Error, state.onFatalError.bind(state, 'create client'));
401+
.on('readable', state.onClientReady.bind(state))
402+
.on('error', state.onFatalError.bind(state, 'create client'));
403403

404404
app.dataService.connect(function() {
405405
ApplicationStore.dataService = app.dataService;

0 commit comments

Comments
 (0)