Merge branch 'master' into email-verification

This commit is contained in:
Kim Gardner
2017-10-19 11:49:10 +01:00
committed by GitHub
10 changed files with 1215 additions and 939 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"exceptions": [
"https://nodesecurity.io/advisories/531"
]
}
-12
View File
@@ -1,12 +0,0 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.7.1
ignore: {}
# patches apply the minimum changes required to fix a vulnerability
patch:
'npm:marked:20170112':
- marked:
patched: '2017-10-11T02:07:15.455Z'
- graphql-docs > marked:
patched: '2017-10-11T02:07:15.455Z'
- simplemde > marked:
patched: '2017-10-11T02:07:15.455Z'
+7 -5
View File
@@ -1,6 +1,8 @@
# Talk [![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk)
# Talk
[![CircleCI](https://circleci.com/gh/coralproject/talk.svg?style=svg)](https://circleci.com/gh/coralproject/talk)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fcoralproject%2Ftalk&env[TALK_FACEBOOK_APP_ID]=ignore&env[TALK_FACEBOOK_APP_SECRET]=ignore)
[![NSP Status](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8/badge)](https://nodesecurity.io/orgs/coralproject/projects/07ce2e4c-99fb-48f8-b50b-69d2d2c081b8)
Online comments are broken. Our open-source Talk tool rethinks how moderation, comment display, and conversation function, creating the opportunity for safer, smarter discussions around your work. [Read more about Talk here](https://coralproject.net/products/talk.html).
@@ -35,10 +37,10 @@ Talk uses [Nightwatch](http://nightwatchjs.org/) to write e2e tests. The testing
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.
See the License for the specific language governing permissions
See the License for the specific language governing permissions
and limitations under the License.
+1 -1
View File
@@ -195,7 +195,7 @@ const performSetup = async () => {
password: user.password
}
});
console.log('Settings created.');
console.log(`User ${newUser.id} created.`);
console.log('\nTalk is now installed!');
+3 -1
View File
@@ -21,7 +21,7 @@ dependencies:
# Install node dependencies.
- yarn --version
- yarn global add node-gyp --force
- yarn global add node-gyp nsp --force
- yarn
post:
# Build the static assets.
@@ -40,6 +40,8 @@ test:
override:
# Run the tests using the junit reporter.
- MOCHA_FILE=$CIRCLE_TEST_REPORTS/junit/test-results.xml MOCHA_REPORTER=mocha-junit-reporter yarn test
# Check dependancies using nsp.
- nsp check
deployment:
release:
@@ -53,7 +53,7 @@ class ProfileContainer extends Component {
};
render() {
const {auth, auth: {user}, showSignInDialog, root, data} = this.props;
const {auth, auth: {user: authUser}, showSignInDialog, root, data} = this.props;
const {me} = this.props.root;
const loading = this.props.data.loading;
@@ -65,14 +65,14 @@ class ProfileContainer extends Component {
return <Spinner />;
}
const localProfile = user.profiles.find(
const localProfile = authUser.profiles.find(
(p) => p.provider === 'local'
);
const emailAddress = localProfile && localProfile.id;
return (
<div className='talk-embed-stream-profile-container'>
<h2>{user.username}</h2>
<h2>{me.username}</h2>
{emailAddress ? <p>{emailAddress}</p> : null}
<Slot
@@ -82,7 +82,6 @@ class ProfileContainer extends Component {
/>
<hr />
<h3>{t('framework.my_comments')}</h3>
{me.comments.nodes.length
? <CommentHistory data={data} root={root} comments={me.comments} link={link} loadMore={this.loadMore}/>
@@ -140,6 +139,7 @@ const withProfileQuery = withQuery(
query CoralEmbedStream_Profile {
me {
id
username
comments(query: {limit: 10}) {
...TalkSettings_CommentConnectionFragment
}
+8
View File
@@ -102,6 +102,14 @@ const SettingSchema = new Schema({
timestamps: {
createdAt: 'created_at',
updatedAt: 'updated_at'
},
toObject: {
transform: (doc, ret) => {
delete ret._id;
delete ret.__v;
return ret;
}
}
});
+31 -27
View File
@@ -15,12 +15,14 @@
"lint": "yamllint locales/*.yml && eslint --ext=.js --ext=.json bin/* .",
"lint-fix": "yarn lint --fix",
"jest-watch": "TEST_MODE=unit NODE_ENV=test jest --watch",
"e2e-ci": "./scripts/e2e-ci.sh",
"e2e-browserstack": "NODE_ENV=test ./scripts/e2e-browserstack.js --config nightwatch-browserstack.conf.js",
"pree2e": "selenium-standalone install",
"e2e": "NODE_ENV=test nightwatch",
"test": "TEST_MODE=unit NODE_ENV=test jest && TEST_MODE=unit NODE_ENV=test mocha -R ${MOCHA_REPORTER:-spec}",
"test-cover": "TEST_MODE=unit NODE_ENV=test istanbul cover _mocha --report text --check-coverage -- -R spec",
"heroku-postbuild": "./bin/cli plugins reconcile && yarn build",
"generate-introspection": "WEBPACK=TRUE NODE_ENV=test ./scripts/generateIntrospectionResult.js",
"snyk-protect": "snyk protect",
"prepublish": "npm run snyk-protect"
"generate-introspection": "WEBPACK=TRUE NODE_ENV=test ./scripts/generateIntrospectionResult.js"
},
"talk": {
"migration": {
@@ -62,36 +64,36 @@
"apollo-client": "^1.9.1",
"app-module-path": "^2.2.0",
"autoprefixer": "^6.5.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.1",
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-async-to-generator": "^6.16.0",
"babel-plugin-transform-class-properties": "^6.23.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-async-to-generator": "6.24.1",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-jsx": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-es2015": "6.24.1",
"babel-preset-react": "^6.23.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.17.2",
"body-parser": "1.18.2",
"bowser": "^1.7.2",
"cli-table": "^0.3.1",
"clipboard": "^1.7.1",
"colors": "^1.1.2",
"commander": "^2.11.0",
"common-tags": "^1.4.0",
"compression": "^1.7.0",
"compression": "1.7.1",
"compression-webpack-plugin": "^1.0.0",
"cookie-parser": "^1.4.3",
"copy-webpack-plugin": "^4.0.0",
"cross-spawn": "^5.1.0",
"css-loader": "^0.28.5",
"dataloader": "^1.3.0",
"debug": "^3.0.1",
"debug": "3.1.0",
"dialog-polyfill": "^0.4.9",
"did-you-mean": "^0.0.1",
"dotenv": "^4.0.0",
@@ -99,44 +101,44 @@
"env-rewrite": "^1.0.2",
"eventemitter2": "^4.1.2",
"exports-loader": "^0.6.4",
"express": "^4.15.4",
"express": "4.16.0",
"file-loader": "^0.11.2",
"form-data": "^2.3.1",
"fs-extra": "^4.0.1",
"gql-merge": "^0.0.4",
"graphql": "^0.9.1",
"graphql-anywhere": "^3.1.0",
"graphql-docs": "^0.2.0",
"graphql-docs": "0.2.0",
"graphql-errors": "^2.1.0",
"graphql-redis-subscriptions": "^1.3.0",
"graphql-redis-subscriptions": "1.3.0",
"graphql-server-express": "^0.6.0",
"graphql-subscriptions": "^0.4.3",
"graphql-tag": "^1.2.3",
"graphql-tools": "^0.10.1",
"hammerjs": "^2.0.8",
"helmet": "^3.8.1",
"helmet": "3.8.2",
"history": "^3.0.0",
"immutability-helper": "^2.2.0",
"imports-loader": "^0.7.1",
"inquirer": "^3.2.2",
"ioredis": "^3.1.4",
"ioredis": "3.1.4",
"istanbul": "^1.1.0-alpha.1",
"joi": "^10.6.0",
"json-loader": "^0.5.7",
"jsonwebtoken": "^7.4.3",
"jwt-decode": "^2.2.0",
"keymaster": "^1.6.2",
"kue": "^0.11.6",
"kue": "0.11.6",
"license-webpack-plugin": "^1.0.0",
"linkify-it": "^2.0.3",
"lodash": "^4.16.6",
"marked": "^0.3.6",
"material-design-lite": "^1.2.1",
"metascraper": "^1.0.7",
"metascraper": "1.0.7",
"minimist": "^1.2.0",
"moment": "^2.18.1",
"mongoose": "^4.11.7",
"morgan": "^1.8.2",
"mongoose": "^4.12.3",
"morgan": "1.9.0",
"ms": "^2.0.0",
"murmurhash-js": "^1.0.0",
"node-emoji": "^1.8.1",
@@ -148,7 +150,7 @@
"pluralize": "^7.0.0",
"postcss-loader": "^1.3.3",
"postcss-smart-import": "^0.5.1",
"precss": "^1.4.0",
"precss": "1.4.0",
"prop-types": "^15.5.10",
"pym.js": "^1.1.1",
"query-string": "^5.0.0",
@@ -169,10 +171,11 @@
"redux": "^3.6.0",
"redux-thunk": "^2.1.0",
"resolve": "^1.4.0",
"selenium-standalone": "6.9.0",
"semver": "^5.4.1",
"simplemde": "^1.11.2",
"smoothscroll-polyfill": "^0.3.5",
"snake-case": "^2.1.0",
"snake-case": "2.1.0",
"style-loader": "^0.16.0",
"subscriptions-transport-ws": "^0.7.2",
"timeago.js": "^2.0.3",
@@ -182,17 +185,17 @@
"url-loader": "^0.6.0",
"url-search-params": "^0.9.0",
"uuid": "^3.1.0",
"webpack": "^2.3.1",
"webpack": "2.4.1",
"webpack-sources": "^1.0.1",
"yaml-loader": "^0.4.0",
"yamljs": "^0.2.10",
"snyk": "^1.42.5"
"yamljs": "^0.2.10"
},
"devDependencies": {
"@coralproject/eslint-config-talk": "^0.0.4",
"babel-jest": "^21.2.0",
"babel-plugin-dynamic-import-node": "^1.1.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"browserstack-local": "^1.3.0",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"chai-http": "^3.0.0",
@@ -204,6 +207,7 @@
"jest": "^21.2.1",
"mocha": "^3.1.2",
"mocha-junit-reporter": "^1.12.1",
"nightwatch": "^0.9.16",
"nodemon": "^1.11.0",
"pre-git": "^3.15.3",
"sinon": "^3.2.1",
+10
View File
@@ -31,6 +31,16 @@ describe('services.SettingsService', () => {
expect(updatedSettings).to.have.property('infoBoxContent', 'yeah');
});
});
it('should be ok when receiving an object based off of a mongoose model', async () => {
const mockSettings = {moderation: 'POST', infoBoxEnable: true, infoBoxContent: 'yeah'};
await SettingsService.update(mockSettings);
const settings = await SettingsService.retrieve();
settings.charCount = 500;
await SettingsService.update(settings.toObject());
});
});
describe('#get', () => {
+1146 -889
View File
File diff suppressed because it is too large Load Diff