Skip to content

Commit b698671

Browse files
rueckstiesskangas
authored andcommitted
INT-793 Add help window
Squashed: :construction: adding help window :shirt: make model/collection for help entries Move help entries to markdown, add sidebar. Fix router for help ipc to parse help markdown entries via ipc Finish laying in all of the groundwork for help :shirt: support local links via `[link](#help-entry)` form fields support help entries, "not found" msg add support for related help entries added tags, devOnly entries, and how-help-works.md :pencil: :add comment explaining template :bug: fix issue connecting to schema window consistent styling of i.help(), more entries moved taxonomy and view hierarchy to help syntax highlighting for code snippets in help :pencil: more help entries
1 parent 035dce7 commit b698671

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1084
-13
lines changed

gulpfile.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ gulp.task('watch', function() {
9595
gulp.watch(['src/*.jade'], ['build:pages']);
9696
gulp.watch('images/{*,**/*}', ['copy:images']);
9797
gulp.watch('fonts/*', ['copy:fonts']);
98+
gulp.watch('src/help/entries/*.md', ['copy:text']);
9899
gulp.watch(['src/electron/{*,**/*}'], ['copy:js']);
99100
gulp.watch('package.json', function() {
100101
gutil.log('package.json changed!');
@@ -232,8 +233,12 @@ gulp.task('copy:package.json', function() {
232233
});
233234

234235
gulp.task('copy:text', function() {
235-
return gulp.src(['README.md'])
236-
.pipe(gulp.dest('build/'));
236+
return merge(
237+
gulp.src('README.md')
238+
.pipe(gulp.dest('build/')),
239+
gulp.src('src/help/entries/*.md')
240+
.pipe(gulp.dest('build/src/help/entries'))
241+
);
237242
});
238243

239244
// Copy non-UI js into the build.

images/help/dev/view_hierarchy.png

207 KB
Loading
11.8 KB
Loading
13.5 KB
Loading

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@
7777
"debug": "^2.2.0",
7878
"electron-squirrel-startup": "^0.1.4",
7979
"keytar": "mongodb-js/node-keytar",
80+
"highlight.js": "^8.9.1",
8081
"localforage": "^1.3.0",
82+
"marky-mark": "^1.2.1",
8183
"mongodb-collection-model": "^0.1.1",
8284
"mongodb-connection-model": "^3.0.7",
8385
"mongodb-instance-model": "^1.0.2",

src/app.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ var MongoDBInstance = require('./models/mongodb-instance');
2828
var User = require('./models/user');
2929
var Router = require('./router');
3030
var Statusbar = require('./statusbar');
31+
var Help = require('./help');
32+
var $ = require('jquery');
3133

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

@@ -119,7 +121,12 @@ var Application = View.extend({
119121
user: User
120122
},
121123
events: {
122-
'click a': 'onLinkClick'
124+
'click a': 'onLinkClick',
125+
'click i.help': 'onHelpClicked'
126+
},
127+
onHelpClicked: function(evt) {
128+
var id = $(evt.target).attr('data-hook');
129+
Help.open(id);
123130
},
124131
onClientReady: function() {
125132
debug('Client ready! Took %dms to become readable',

src/connect/authentication.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ var MONGODB = {
3838
new InputView({
3939
template: inputTemplate,
4040
name: 'mongodb_database_name',
41-
label: 'Database Name',
41+
label: 'Authentication Database',
4242
placeholder: 'admin',
43+
helpEntry: 'connect-userpass-auth-db',
4344
required: false
4445
})
4546
]
@@ -57,6 +58,7 @@ var KERBEROS = {
5758
name: 'kerberos_principal',
5859
label: 'Principal',
5960
placeholder: '',
61+
helpEntry: 'connect-kerberos-principal',
6062
required: true,
6163
tests: [
6264
function(value) {

src/connect/connect-form-view.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ var ConnectFormView = FormView.extend({
187187
name: 'name',
188188
label: 'Favorite Name',
189189
placeholder: 'e.g. Shared Dev, QA Box, PRODUCTION',
190+
helpEntry: 'connect-favorite-name',
190191
required: false
191192
})
192193
];

src/connect/filereader-default.jade

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.form-item
2-
label(data-hook='label')= label
2+
label
3+
span(data-hook='label')= label
4+
if helpEntry
5+
i.help(data-hook='#{helpEntry}')
36
.message.message-below.message-error(data-hook='message-container')
47
p(data-hook='message-text')
58
.form-item-file

src/connect/filereader-view.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ module.exports = InputView.extend({
3030
type: 'boolean',
3131
required: true,
3232
default: false
33+
},
34+
helpEntry: {
35+
type: 'string',
36+
default: null
3337
}
3438
},
3539
derived: {
@@ -91,6 +95,9 @@ module.exports = InputView.extend({
9195
_.defaults(spec, {
9296
value: []
9397
});
98+
if (spec.helpEntry) {
99+
this.helpEntry = spec.helpEntry;
100+
}
94101
this.invalidClass = 'has-error';
95102
this.validityClassSelector = '.form-item-file';
96103
InputView.prototype.initialize.call(this, spec);

0 commit comments

Comments
 (0)