diff --git a/src/connect/behavior.js b/src/connect/behavior.js index caa7148bec3..04060b96c51 100644 --- a/src/connect/behavior.js +++ b/src/connect/behavior.js @@ -108,7 +108,7 @@ module.exports = State.extend({ switch (action) { case 'new connection clicked': newState = 'NEW_EMPTY'; - view.authMethod = 'MONGODB'; + view.authMethod = 'NONE'; view.sslMethod = 'NONE'; view.form.reset(); view.message = ''; diff --git a/src/connect/connect-form-view.js b/src/connect/connect-form-view.js index d1e1a3d1999..026d0f087c5 100644 --- a/src/connect/connect-form-view.js +++ b/src/connect/connect-form-view.js @@ -148,8 +148,7 @@ var ConnectFormView = FormView.extend({ // you can pass in a collection here too options: enabledAuthOptions, // and pick an item from the collection as the selected one - // @todo thomasr: pick the "model.selected" one (via .find() ?) - value: enabledAuthOptions.get('MONGODB'), + value: enabledAuthOptions.get('NONE'), // here you specify which attribute on the objects in the collection // to use for the value returned. idAttribute: '_id', @@ -186,7 +185,7 @@ var ConnectFormView = FormView.extend({ template: require('./input-default.jade'), el: this.parent.queryByHook('saveas-subview'), name: 'name', - label: 'Name', + label: 'Favorite Name', placeholder: 'e.g. Shared Dev, QA Box, PRODUCTION', required: false }) diff --git a/src/connect/filereader-view.js b/src/connect/filereader-view.js index 31066f4c266..7af4be0ef23 100644 --- a/src/connect/filereader-view.js +++ b/src/connect/filereader-view.js @@ -7,12 +7,18 @@ var BrowserWindow = remote.require('browser-window'); var format = require('util').format; var bindings = require('ampersand-dom-bindings'); var fileReaderTemplate = require('./filereader-default.jade'); +var assert = require('assert'); // var debug = require('debug')('scout:connect:filereader-view'); module.exports = InputView.extend({ template: fileReaderTemplate, props: { + multi: { + type: 'boolean', + required: true, + default: false + }, inputValue: { type: 'array', required: true, @@ -31,10 +37,11 @@ module.exports = InputView.extend({ deps: ['inputValue'], fn: function() { if (this.inputValue.length === 0) { - return 'Choose certificate(s)'; + return this.multi ? 'Choose file(s)' : 'Choose file'; } else if (this.inputValue.length === 1) { return path.basename(this.inputValue[0]); } + assert.equal(this.multi, true); return format('%d files selected', this.inputValue.length); } }, @@ -78,6 +85,9 @@ module.exports = InputView.extend({ */ initialize: function(spec) { spec = spec || {}; + if (spec.multi) { + this.multi = spec.multi; + } _.defaults(spec, {value: []}); this.invalidClass = 'has-error'; this.validityClassSelector = '.form-item-file'; @@ -173,8 +183,12 @@ module.exports = InputView.extend({ this.runTests(); }, loadFileButtonClicked: function() { + var properties = ['openFile']; + if (this.multi) { + properties.push('multiSelections'); + } dialog.showOpenDialog(BrowserWindow.getFocusedWindow(), { - properties: ['openFile', 'multiSelections'] + properties: properties }, function(filenames) { this.inputValue = filenames || []; this.handleChange(); diff --git a/src/connect/index.js b/src/connect/index.js index f2a81c8dca5..463bbdc4c18 100644 --- a/src/connect/index.js +++ b/src/connect/index.js @@ -47,7 +47,7 @@ var ConnectView = View.extend({ }, authMethod: { type: 'string', - default: 'MONGODB' + default: 'NONE' }, previousAuthMethod: { type: 'string', diff --git a/src/connect/index.less b/src/connect/index.less index 4c3e311f74b..bc09bed0e67 100644 --- a/src/connect/index.less +++ b/src/connect/index.less @@ -131,7 +131,7 @@ .form-item { margin: 15px auto 15px; - width: 425px; + width: 450px; overflow: auto; > * { diff --git a/src/connect/ssl.js b/src/connect/ssl.js index b90de9ea9e8..c1f2faaf0d4 100644 --- a/src/connect/ssl.js +++ b/src/connect/ssl.js @@ -39,6 +39,7 @@ var SERVER = { fields: [ new FileReaderView({ name: 'ssl_ca', + multi: true, label: 'Certificate Authority', required: true }) @@ -56,23 +57,24 @@ var ALL = { fields: [ new FileReaderView({ name: 'ssl_ca', + multi: true, label: 'Certificate Authority', required: true }), new FileReaderView({ name: 'ssl_private_key', - label: 'Certificate Key', + label: 'Client Certificate Key', required: true }), new FileReaderView({ name: 'ssl_certificate', - label: 'Certificate', + label: 'Client Certificate', required: true }), new InputView({ template: inputTemplate, name: 'ssl_private_key_password', - label: 'Private Key Password', + label: 'Client Key Password', required: false }) ]