Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cb61a02
:construction: adding help window
rueckstiess Nov 13, 2015
5f334aa
:shirt:
imlucas Nov 14, 2015
a4d1ece
make model/collection for help entries
imlucas Nov 14, 2015
a1d0981
Move help entries to markdown, add sidebar.
imlucas Nov 14, 2015
0de6a5c
Fix router for help
imlucas Nov 14, 2015
35ac7b6
ipc to parse help markdown entries via ipc
imlucas Nov 14, 2015
75690aa
Finish laying in all of the groundwork for help
imlucas Nov 14, 2015
5e381a8
:shirt:
imlucas Nov 14, 2015
3b2cc6a
support local links via `[link](#help-entry)`
rueckstiess Nov 15, 2015
f85894b
form fields support help entries, "not found" msg
rueckstiess Nov 15, 2015
f9a8419
add support for related help entries
rueckstiess Nov 15, 2015
3398a04
added tags, devOnly entries, and how-help-works.md
rueckstiess Nov 15, 2015
43e119f
:pencil: :add comment explaining template
rueckstiess Nov 15, 2015
1cea3b0
:bug: fix issue connecting to schema window
rueckstiess Nov 16, 2015
2fbdec2
consistent styling of i.help(), more entries
rueckstiess Nov 16, 2015
3c162e1
moved taxonomy and view hierarchy to help
rueckstiess Nov 16, 2015
50ddb13
syntax highlighting for code snippets in help
rueckstiess Nov 16, 2015
6fa4ee8
:pencil: more help entries
rueckstiess Nov 16, 2015
25802c7
INT-833 help window behaviour modifications
WaleyChen Nov 17, 2015
7557d74
INT-833 help window not clicking element bug fix
WaleyChen Nov 17, 2015
6af9aad
INT-833 code cleanup
WaleyChen Nov 17, 2015
ce99fa0
INT-833 fix nom run check
WaleyChen Nov 17, 2015
66fe8b3
INT-833 redundant code
WaleyChen Nov 17, 2015
2d1bdf2
INT-833 use loadURL instead of executeJS
WaleyChen Nov 17, 2015
41e0481
send message instead of loadURL, much faster
rueckstiess Nov 18, 2015
68e26b5
Cmd-H is already used, use F1 accelerator for help
rueckstiess Nov 18, 2015
5036511
Merge branch 'master' into INT-793-help-windows
rueckstiess Nov 18, 2015
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
9 changes: 7 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ gulp.task('watch', function() {
gulp.watch(['src/*.jade'], ['build:pages']);
gulp.watch('images/{*,**/*}', ['copy:images']);
gulp.watch('fonts/*', ['copy:fonts']);
gulp.watch('src/help/entries/*.md', ['copy:text']);
gulp.watch(['src/electron/{*,**/*}'], ['copy:js']);
gulp.watch('package.json', function() {
gutil.log('package.json changed!');
Expand Down Expand Up @@ -232,8 +233,12 @@ gulp.task('copy:package.json', function() {
});

gulp.task('copy:text', function() {
return gulp.src(['README.md'])
.pipe(gulp.dest('build/'));
return merge(
gulp.src('README.md')
.pipe(gulp.dest('build/')),
gulp.src('src/help/entries/*.md')
.pipe(gulp.dest('build/src/help/entries'))
);
});

// Copy non-UI js into the build.
Expand Down
Binary file added images/help/dev/view_hierarchy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/help/schema/sampling-results-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/help/schema/sampling-results-sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
"dependencies": {
"debug": "^2.2.0",
"electron-squirrel-startup": "^0.1.4",
"highlight.js": "^8.9.1",
"keytar": "mongodb-js/node-keytar",
"localforage": "^1.3.0",
"marky-mark": "^1.2.1",
"mongodb-collection-model": "^0.1.1",
"mongodb-connection-model": "^3.0.7",
"mongodb-instance-model": "^1.0.2",
Expand Down
18 changes: 12 additions & 6 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var MongoDBInstance = require('./models/mongodb-instance');
var User = require('./models/user');
var Router = require('./router');
var Statusbar = require('./statusbar');
var $ = require('jquery');

var debug = require('debug')('scout:app');

Expand Down Expand Up @@ -119,7 +120,12 @@ var Application = View.extend({
user: User
},
events: {
'click a': 'onLinkClick'
'click a': 'onLinkClick',
'click i.help': 'onHelpClicked'
},
onHelpClicked: function(evt) {
var id = $(evt.target).attr('data-hook');
app.sendMessage('show help window', id);
},
onClientReady: function() {
debug('Client ready! Took %dms to become readable',
Expand Down Expand Up @@ -284,12 +290,12 @@ app.extend({
setFeature: function(id, bool) {
FEATURES[id] = bool;
},
sendMessage: function(msg, arg1) {
ipc.send('message', msg, arg1);
sendMessage: function(msg, arg) {
ipc.send('message', msg, arg);
},
onMessageReceived: function(msg) {
debug('message received from main process:', msg);
this.trigger(msg);
onMessageReceived: function(msg, arg) {
debug('message received from main process:', msg, arg);
this.trigger(msg, arg);
},
metrics: metrics,
init: function() {
Expand Down
5 changes: 4 additions & 1 deletion src/connect/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ var MONGODB = {
new InputView({
template: inputTemplate,
name: 'mongodb_database_name',
label: 'Database Name',
label: 'Authentication Database',
placeholder: 'admin',
helpEntry: 'connect-userpass-auth-db',
required: false
})
]
Expand All @@ -56,13 +57,15 @@ var KERBEROS = {
name: 'kerberos_service_name',
label: 'Kerberos Service Name',
placeholder: 'mongodb',
helpEntry: 'connect-kerberos-service-name',
required: false
}),
new InputView({
template: inputTemplate,
name: 'kerberos_principal',
label: 'Kerberos Principal',
placeholder: '',
helpEntry: 'connect-kerberos-principal',
required: true
}),
new InputView({
Expand Down
1 change: 1 addition & 0 deletions src/connect/connect-form-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ var ConnectFormView = FormView.extend({
name: 'name',
label: 'Favorite Name',
placeholder: 'e.g. Shared Dev, QA Box, PRODUCTION',
helpEntry: 'connect-favorite-name',
required: false
})
];
Expand Down
5 changes: 4 additions & 1 deletion src/connect/filereader-default.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.form-item
label(data-hook='label')= label
label
span(data-hook='label')= label
if helpEntry
i.help(data-hook='#{helpEntry}')
.message.message-below.message-error(data-hook='message-container')
p(data-hook='message-text')
.form-item-file
Expand Down
7 changes: 7 additions & 0 deletions src/connect/filereader-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ module.exports = InputView.extend({
type: 'boolean',
required: true,
default: false
},
helpEntry: {
type: 'string',
default: null
}
},
derived: {
Expand Down Expand Up @@ -91,6 +95,9 @@ module.exports = InputView.extend({
_.defaults(spec, {
value: []
});
if (spec.helpEntry) {
this.helpEntry = spec.helpEntry;
}
this.invalidClass = 'has-error';
this.validityClassSelector = '.form-item-file';
InputView.prototype.initialize.call(this, spec);
Expand Down
5 changes: 4 additions & 1 deletion src/connect/input-default.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.form-item
label(data-hook='label')= label
label
span(data-hook='label')= label
if helpEntry
i.help(data-hook='#{helpEntry}')
.message.message-above.message-error(data-hook='message-container')
p(data-hook='message-text')
input.form-control(placeholder='#{placeholder}')
12 changes: 11 additions & 1 deletion src/connect/input-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ var InputView = require('ampersand-input-view');
* so that label gets correctly rendered on subsequent render() calls.
*/
module.exports = InputView.extend({
initialize: function() {
props: {
helpEntry: {
type: 'string',
default: null
}
},
initialize: function(spec) {
spec = spec || {};
if (spec.helpEntry) {
this.helpEntry = spec.helpEntry;
}
this.invalidClass = 'has-error';
this.validityClassSelector = '.form-item';
InputView.prototype.initialize.apply(this, arguments);
Expand Down
5 changes: 4 additions & 1 deletion src/connect/select-default.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.form-item
label(data-hook='label')= label
label
span(data-hook='label')= label
if helpEntry
i.help(data-hook='#{helpEntry}')
.message.message-below.message-error(data-hook='message-container')
p(data-hook='message-text')
select.form-control(type='select')
5 changes: 5 additions & 0 deletions src/connect/ssl.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var SERVER = {
name: 'ssl_ca',
multi: true,
label: 'Certificate Authority',
helpEntry: 'connect-ssl-certificate-authority',
required: true
})
]
Expand All @@ -59,22 +60,26 @@ var ALL = {
name: 'ssl_ca',
multi: true,
label: 'Certificate Authority',
helpEntry: 'connect-ssl-certificate-authority',
required: true
}),
new FileReaderView({
name: 'ssl_private_key',
label: 'Client Certificate Key',
helpEntry: 'connect-ssl-client-certificate-key',
required: true
}),
new FileReaderView({
name: 'ssl_certificate',
label: 'Client Certificate',
helpEntry: 'connect-ssl-client-certificate',
required: true
}),
new InputView({
template: inputTemplate,
name: 'ssl_private_key_password',
label: 'Client Key Password',
helpEntry: 'connect-ssl-private-key-password',
required: false
})
]
Expand Down
39 changes: 39 additions & 0 deletions src/electron/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
var path = require('path');
var ipc = require('ipc');
var mm = require('marky-mark');
var _ = require('lodash');
var highlight = require('highlight.js');

var debug = require('debug')('scout:electron:help');

debug('adding ipc listener for `/help/entries`...');
ipc.on('/help/entries', function(evt) {
var dir = path.join(__dirname, '..', 'help', 'entries');
debug('parsing entries with marky-mark from `%s`', dir);

// add syntax highlighting options, pass through to `marked` module
var options = {
marked: {
highlight: function(code) {
var result = highlight.highlightAuto(code).value;
return result;
}
}
};

mm.parseDirectory(dir, options, function(err, posts) {
if (err) {
debug('error parsing entries', err);
evt.sender.send('/help/entries/error', err);
return;
}
debug('successfully parsed!', posts);
// in production don't return the dev-only entries
if (process.env.NODE_ENV === 'production') {
posts = _.filter(posts, function(post) {
return !post.meta.devOnly;
});
}
evt.sender.send('/help/entries/success', posts);
});
});
4 changes: 4 additions & 0 deletions src/electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ if (!require('electron-squirrel-startup')) {
var AppMenu = require('./menu');
AppMenu.init();
require('./window-manager');

app.on('ready', function() {
require('./help');
});
}
Loading