Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages
62 changes: 62 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"allowImportExportEverywhere": true
},
"plugins": [
"meteor"
],
"extends": [
"airbnb",
"plugin:meteor/recommended"
],
"rules": {
"import/extensions": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
"no-underscore-dangle": "off",
"class-methods-use-this": "off",
"meteor/no-session": "off",
"object-shorthand": [
"error",
"always",
{
"avoidQuotes": false
}
],
"meteor/eventmap-params": [
"error",
{
"eventParamName": "event",
"templateInstanceParamName": "instance"
}
],
"meteor/template-names": [
"off"
],
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx"
]
}
],
"react/forbid-prop-types": "off",
"jsx-a11y/no-static-element-interactions": "off",
"prefer-arrow-callback": "off"
},
"settings": {
"import/resolver": "meteor"
},
"globals": {
"window": true,
"document": true
}
}
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
.DS_Store
settings-production.json
npm-debug.log

# OSX
#
.DS_Store
.tmp/

# IntelliJ
#
.idea

# node.js
#
node_modules
npm-debug.log
yarn-error.log

10 changes: 5 additions & 5 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ session@1.1.7
tracker@1.1.2 # Meteor's client-side reactive programming library

standard-minifier-css@1.3.4 # CSS minifier run for production mode
standard-minifier-js@1.2.3 # JS minifier run for production mode
standard-minifier-js@2.0.0 # JS minifier run for production mode
es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.6.3 # Enable ECMAScript2015+ syntax in app code
ecmascript@0.7.2 # Enable ECMAScript2015+ syntax in app code

accounts-password@1.3.4
accounts-base@1.2.15
accounts-password@1.3.5
accounts-base@1.2.16
check@1.2.5
audit-argument-checks@1.0.7
browser-policy@1.1.0

fourseven:scss@4.5.0
aldeed:collection2
alanning:roles
themeteorchef:bert
static-html@1.1.11
Expand All @@ -34,3 +33,4 @@ mdg:validated-method
dburles:factory@1.0.0
ddp-rate-limiter@1.0.7
shell-server@0.2.3
aldeed:collection2-core@2.0.0
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.4.3.2
METEOR@1.4.4.1
54 changes: 25 additions & 29 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
accounts-base@1.2.15
accounts-password@1.3.4
accounts-base@1.2.16
accounts-password@1.3.5
alanning:roles@1.2.16
aldeed:collection2@2.10.0
aldeed:collection2-core@1.2.0
aldeed:schema-deny@1.1.0
aldeed:schema-index@1.1.1
aldeed:simple-schema@1.5.3
aldeed:collection2-core@2.0.0
allow-deny@1.0.5
audit-argument-checks@1.0.7
autoupdate@1.3.12
babel-compiler@6.14.1
babel-compiler@6.18.2
babel-runtime@1.0.1
base64@1.0.10
binary-heap@1.0.10
blaze@2.3.0
blaze@2.3.2
blaze-tools@1.0.10
boilerplate-generator@1.0.11
browser-policy@1.1.0
browser-policy-common@1.0.11
browser-policy-content@1.1.0
browser-policy-framing@1.1.0
caching-compiler@1.1.9
caching-html-compiler@1.1.0
caching-html-compiler@1.1.2
callback-hook@1.0.10
check@1.2.5
coffeescript@1.12.3_1
dburles:factory@1.1.0
ddp@1.2.5
ddp-client@1.3.3
ddp-client@1.3.4
ddp-common@1.2.8
ddp-rate-limiter@1.0.7
ddp-server@1.3.13
ddp-server@1.3.14
deps@1.0.12
diff-sequence@1.0.7
ecmascript@0.6.3
ecmascript@0.7.3
ecmascript-runtime@0.3.15
ejson@1.0.13
email@1.1.18
email@1.2.1
es5-shim@4.6.15
fastclick@1.0.13
fortawesome:fontawesome@4.7.0
Expand All @@ -53,16 +49,15 @@ livedata@1.0.18
localstorage@1.0.12
logging@1.1.17
mdg:validated-method@1.1.0
mdg:validation-error@0.5.1
meteor@1.6.1
meteor-base@1.0.4
minifier-css@1.2.16
minifier-js@1.2.18
minifier-js@2.0.0
minimongo@1.0.21
mobile-experience@1.0.4
mobile-status-bar@1.0.14
modules@0.7.9
modules-runtime@0.7.9
modules@0.8.2
modules-runtime@0.7.10
mongo@1.1.16
mongo-id@1.0.6
npm-bcrypt@0.9.2
Expand All @@ -77,7 +72,7 @@ practicalmeteor:sinon@1.14.1_2
promise@0.8.8
raix:eventemitter@0.1.3
random@1.0.10
rate-limit@1.0.7
rate-limit@1.0.8
reactive-dict@1.1.8
reactive-var@1.0.11
reload@1.1.11
Expand All @@ -87,23 +82,24 @@ service-configuration@1.0.11
session@1.1.7
sha@1.0.9
shell-server@0.2.3
spacebars@1.0.13
spacebars-compiler@1.1.0
spacebars@1.0.15
spacebars-compiler@1.1.2
srp@1.0.10
standard-minifier-css@1.3.4
standard-minifier-js@1.2.3
static-html@1.2.0
templating@1.3.0
templating-compiler@1.3.0
templating-runtime@1.3.0
templating-tools@1.1.0
standard-minifier-js@2.0.0
static-html@1.2.2
templating@1.3.2
templating-compiler@1.3.2
templating-runtime@1.3.2
templating-tools@1.1.2
themeteorchef:bert@2.1.2
tmeasday:check-npm-versions@0.3.1
tmeasday:test-reporter-helpers@0.2.1
tracker@1.1.2
ui@1.0.12
ui@1.0.13
underscore@1.0.10
url@1.1.0
webapp@1.3.14
webapp@1.3.15
webapp-hashing@1.0.9
xolvio:backdoor@0.2.1
xolvio:cleaner@0.3.1
11 changes: 11 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MIT

---

Copyright (c) 2014-2017 The Meteor Chef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ A starting point for Meteor apps.
<tbody>
<tr>
<th>Base Version</th>
<td>v4.14.0</td>
<td>v4.15.0</td>
</tr>
<tr>
<th>Meteor Version</th>
<td>v1.4.3.2</td>
<td>v1.4.4.1</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion imports/api/documents/documents.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import SimpleSchema from 'simpl-schema';
import { Factory } from 'meteor/dburles:factory';

const Documents = new Mongo.Collection('Documents');
Expand Down
2 changes: 1 addition & 1 deletion imports/api/documents/methods.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import SimpleSchema from 'simpl-schema';
import { ValidatedMethod } from 'meteor/mdg:validated-method';
import Documents from './documents';
import rateLimit from '../../modules/rate-limit.js';
Expand Down
13 changes: 13 additions & 0 deletions imports/api/users/server/publications.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Meteor } from 'meteor/meteor';

Meteor.publish('users.info', function userInfoPublish() {
if (!this.userId) {
return this.ready();
}

return Meteor.users.find(this.userId, {
fields: {
name: 1,
},
});
});
6 changes: 6 additions & 0 deletions imports/modules/container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { compose } from 'react-komposer';
import getTrackerLoader from './get-tracker-loader';

export default function container(composer, Component, options = {}) {
return compose(getTrackerLoader(composer), options)(Component);
}
9 changes: 4 additions & 5 deletions imports/modules/document-editor.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/* eslint-disable no-undef */

import { browserHistory } from 'react-router';
import { Bert } from 'meteor/themeteorchef:bert';
import { upsertDocument } from '../api/documents/methods.js';
import './validation.js';

let component;

const handleUpsert = () => {
const { doc } = component.props;
const { doc, history } = component.props;
const confirmation = doc && doc._id ? 'Document updated!' : 'Document added!';
const upsert = {
title: document.querySelector('[name="title"]').value.trim(),
Expand All @@ -23,7 +22,7 @@ const handleUpsert = () => {
} else {
component.documentEditorForm.reset();
Bert.alert(confirmation, 'success');
browserHistory.push(`/documents/${response.insertedId || doc._id}`);
history.push(`/documents/${response.insertedId || doc._id}`);
}
});
};
Expand All @@ -40,10 +39,10 @@ const validate = () => {
},
messages: {
title: {
required: 'Need a title in here, Seuss.',
required: 'Need a title in here, thanks!.',
},
body: {
required: 'This thneeds a body, please.',
required: 'This needs a body, please.',
},
},
submitHandler() { handleUpsert(); },
Expand Down
21 changes: 21 additions & 0 deletions imports/modules/get-tracker-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Tracker } from 'meteor/tracker';

const getTrackerLoader = reactiveMapper => (
(props, onData, env) => {
let trackerCleanup = null;

const handler = Tracker.nonreactive(() =>
Tracker.autorun(() => {
trackerCleanup = reactiveMapper(props, onData, env);
}),
);

return () => {
if (typeof trackerCleanup === 'function') trackerCleanup();
return handler.stop();
};
}
);

export default getTrackerLoader;

7 changes: 3 additions & 4 deletions imports/modules/login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable no-undef */

import { browserHistory } from 'react-router';
import { Meteor } from 'meteor/meteor';
import { Bert } from 'meteor/themeteorchef:bert';
import './validation.js';
Expand All @@ -17,11 +16,11 @@ const login = () => {
} else {
Bert.alert('Logged in!', 'success');

const { location } = component.props;
const { location, history } = component.props;
if (location.state && location.state.nextPathname) {
browserHistory.push(location.state.nextPathname);
history.push(location.state.nextPathname);
} else {
browserHistory.push('/');
history.push('/');
}
}
});
Expand Down
Loading