Skip to content

Commit d79c864

Browse files
committed
Merge pull request #215 from 10gen/INT-812-none-auth-default
INT-812 make Authentication "None" the default
2 parents bb610b7 + 7e05146 commit d79c864

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

src/connect/behavior.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module.exports = State.extend({
108108
switch (action) {
109109
case 'new connection clicked':
110110
newState = 'NEW_EMPTY';
111-
view.authMethod = 'MONGODB';
111+
view.authMethod = 'NONE';
112112
view.sslMethod = 'NONE';
113113
view.form.reset();
114114
view.message = '';

src/connect/connect-form-view.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ var ConnectFormView = FormView.extend({
148148
// you can pass in a collection here too
149149
options: enabledAuthOptions,
150150
// and pick an item from the collection as the selected one
151-
// @todo thomasr: pick the "model.selected" one (via .find() ?)
152-
value: enabledAuthOptions.get('MONGODB'),
151+
value: enabledAuthOptions.get('NONE'),
153152
// here you specify which attribute on the objects in the collection
154153
// to use for the value returned.
155154
idAttribute: '_id',
@@ -186,7 +185,7 @@ var ConnectFormView = FormView.extend({
186185
template: require('./input-default.jade'),
187186
el: this.parent.queryByHook('saveas-subview'),
188187
name: 'name',
189-
label: 'Name',
188+
label: 'Favorite Name',
190189
placeholder: 'e.g. Shared Dev, QA Box, PRODUCTION',
191190
required: false
192191
})

src/connect/filereader-view.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ var BrowserWindow = remote.require('browser-window');
77
var format = require('util').format;
88
var bindings = require('ampersand-dom-bindings');
99
var fileReaderTemplate = require('./filereader-default.jade');
10+
var assert = require('assert');
1011

1112
// var debug = require('debug')('scout:connect:filereader-view');
1213

1314
module.exports = InputView.extend({
1415
template: fileReaderTemplate,
1516
props: {
17+
multi: {
18+
type: 'boolean',
19+
required: true,
20+
default: false
21+
},
1622
inputValue: {
1723
type: 'array',
1824
required: true,
@@ -31,10 +37,11 @@ module.exports = InputView.extend({
3137
deps: ['inputValue'],
3238
fn: function() {
3339
if (this.inputValue.length === 0) {
34-
return 'Choose certificate(s)';
40+
return this.multi ? 'Choose file(s)' : 'Choose file';
3541
} else if (this.inputValue.length === 1) {
3642
return path.basename(this.inputValue[0]);
3743
}
44+
assert.equal(this.multi, true);
3845
return format('%d files selected', this.inputValue.length);
3946
}
4047
},
@@ -78,6 +85,9 @@ module.exports = InputView.extend({
7885
*/
7986
initialize: function(spec) {
8087
spec = spec || {};
88+
if (spec.multi) {
89+
this.multi = spec.multi;
90+
}
8191
_.defaults(spec, {value: []});
8292
this.invalidClass = 'has-error';
8393
this.validityClassSelector = '.form-item-file';
@@ -173,8 +183,12 @@ module.exports = InputView.extend({
173183
this.runTests();
174184
},
175185
loadFileButtonClicked: function() {
186+
var properties = ['openFile'];
187+
if (this.multi) {
188+
properties.push('multiSelections');
189+
}
176190
dialog.showOpenDialog(BrowserWindow.getFocusedWindow(), {
177-
properties: ['openFile', 'multiSelections']
191+
properties: properties
178192
}, function(filenames) {
179193
this.inputValue = filenames || [];
180194
this.handleChange();

src/connect/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var ConnectView = View.extend({
4747
},
4848
authMethod: {
4949
type: 'string',
50-
default: 'MONGODB'
50+
default: 'NONE'
5151
},
5252
previousAuthMethod: {
5353
type: 'string',

src/connect/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131

132132
.form-item {
133133
margin: 15px auto 15px;
134-
width: 425px;
134+
width: 450px;
135135
overflow: auto;
136136

137137
> * {

src/connect/ssl.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var SERVER = {
3939
fields: [
4040
new FileReaderView({
4141
name: 'ssl_ca',
42+
multi: true,
4243
label: 'Certificate Authority',
4344
required: true
4445
})
@@ -56,23 +57,24 @@ var ALL = {
5657
fields: [
5758
new FileReaderView({
5859
name: 'ssl_ca',
60+
multi: true,
5961
label: 'Certificate Authority',
6062
required: true
6163
}),
6264
new FileReaderView({
6365
name: 'ssl_private_key',
64-
label: 'Certificate Key',
66+
label: 'Client Certificate Key',
6567
required: true
6668
}),
6769
new FileReaderView({
6870
name: 'ssl_certificate',
69-
label: 'Certificate',
71+
label: 'Client Certificate',
7072
required: true
7173
}),
7274
new InputView({
7375
template: inputTemplate,
7476
name: 'ssl_private_key_password',
75-
label: 'Private Key Password',
77+
label: 'Client Key Password',
7678
required: false
7779
})
7880
]

0 commit comments

Comments
 (0)