From 7f86c936add27e9a1f1054aa442e97d0ba105de2 Mon Sep 17 00:00:00 2001 From: gaba Date: Wed, 21 Dec 2016 13:17:04 -0800 Subject: [PATCH 01/11] Adds a very simple INSTALL file for devs. --- INSTALL.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 000000000..b5af7529d --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,85 @@ +# BUILDING FROM SOURCE + +By contributing to this project you agree to the [Code of Conduct](https://coralproject.net/code-of-conduct.html). + +## Requirements + +* [Node 7.2.1](https://nodejs.org/es/download/package-manager) +* Mongo 3.4.0 +* Redis 3.2.6 + +### Operating System + +- We recommend hosting [Talk](https://github.com/coralproject/talk) with any flavor of Linux +- 1GB memory (minimum) +- 5GB storage (minimum) + +## Initial Setup + +### Get the code + +Clone the repository: + +` +git clone https://github.com/coralproject/talk +` + +### Installation + +* cd talk +* npm install +* npm run build + +### Environmental Variables + + export TALK_PORT=5000 + export TALK_MONGO_URL=mongodb://localhost/talk + export TALK_REDIS_URL=redis://redis/talk + export TALK_SESSION_SECRET=somethingsecret + export TALK_FACEBOOK_APP_ID=fbidapp_youneeditforfbconnect + export TALK_FACEBOOK_APP_SECRET=fbappsecret_youneeditforfbconnect + export TALK_ROOT_URL=http://localhost:5000 + export TALK_SMTP_USERNAME=coralproject + export TALK_SMTP_PASSWORD=smtppassword + export TALK_SMTP_HOST=smtp.example.net + export TALK_SMTP_PROVIDER=Example + +### Local development + +` +npm start +` + +It will run in http://localhost:5000 + + +### Testing + +Run all tests once via: + +` +npm test +` + +` +npm run e2e +` + +## Recommendations for Deployment + +##### Web Server + +* [Caddy](https://caddyserver.com/) + +##### SSL Certificates + +* [Let's Encrypt](https://letsencrypt.org/) + + +## Troubleshooting + + +##### Can't ping the redis server! + +- Check that Redis Server is running. +- Check that TALK_REDIS_URL is set. From 54bad908b3fa587fd206b4f0f06fe24b9099c985 Mon Sep 17 00:00:00 2001 From: gaba Date: Wed, 21 Dec 2016 16:01:16 -0800 Subject: [PATCH 02/11] Apply changes from review. --- INSTALL.md | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index b5af7529d..c9a56b96c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,10 +4,10 @@ By contributing to this project you agree to the [Code of Conduct](https://coral ## Requirements -* [Node 7.2.1](https://nodejs.org/es/download/package-manager) -* Mongo 3.4.0 -* Redis 3.2.6 - +* [Node](https://nodejs.org/es/download/package-manager) +* Mongo +* Redis +* ### Operating System - We recommend hosting [Talk](https://github.com/coralproject/talk) with any flavor of Linux @@ -28,7 +28,6 @@ git clone https://github.com/coralproject/talk * cd talk * npm install -* npm run build ### Environmental Variables @@ -50,7 +49,7 @@ git clone https://github.com/coralproject/talk npm start ` -It will run in http://localhost:5000 +It will run in http://localhost:$PORT ### Testing @@ -65,17 +64,6 @@ npm test npm run e2e ` -## Recommendations for Deployment - -##### Web Server - -* [Caddy](https://caddyserver.com/) - -##### SSL Certificates - -* [Let's Encrypt](https://letsencrypt.org/) - - ## Troubleshooting From 39222759f9695f2f9f27a342b9f166e13678e1ec Mon Sep 17 00:00:00 2001 From: gaba Date: Thu, 22 Dec 2016 08:31:00 -0800 Subject: [PATCH 03/11] Adds links between README and INSTALL. --- INSTALL.md | 14 ++------------ README.md | 5 +++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index c9a56b96c..623e48ffc 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -7,7 +7,7 @@ By contributing to this project you agree to the [Code of Conduct](https://coral * [Node](https://nodejs.org/es/download/package-manager) * Mongo * Redis -* + ### Operating System - We recommend hosting [Talk](https://github.com/coralproject/talk) with any flavor of Linux @@ -31,17 +31,7 @@ git clone https://github.com/coralproject/talk ### Environmental Variables - export TALK_PORT=5000 - export TALK_MONGO_URL=mongodb://localhost/talk - export TALK_REDIS_URL=redis://redis/talk - export TALK_SESSION_SECRET=somethingsecret - export TALK_FACEBOOK_APP_ID=fbidapp_youneeditforfbconnect - export TALK_FACEBOOK_APP_SECRET=fbappsecret_youneeditforfbconnect - export TALK_ROOT_URL=http://localhost:5000 - export TALK_SMTP_USERNAME=coralproject - export TALK_SMTP_PASSWORD=smtppassword - export TALK_SMTP_HOST=smtp.example.net - export TALK_SMTP_PROVIDER=Example +This project is using many environmental variables for configuration. You can learn about them in the [README's file](README.md). ### Local development diff --git a/README.md b/README.md index 3b258736f..48aca3a90 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,11 @@ available in the format: `://` without the path. - `TALK_SMTP_HOST` (*required*) - SMTP host url with format `smtp.domain.com`. - `TALK_SMTP_PORT` (*required*) - SMTP port. + +### Install from Source + +If you want to run Talk in development mode from source (without docker) you can read the [INSTALL file](INSTALL.md). + ### License Copyright 2016 Mozilla Foundation From ef40cf37fe943824c23fc35171f06e4d3c824421 Mon Sep 17 00:00:00 2001 From: David Erwin Date: Tue, 27 Dec 2016 10:55:16 -0500 Subject: [PATCH 04/11] Update contribution guide --- CONTRIBUTING.md | 139 +++++++++++++++++++----------------------------- 1 file changed, 56 insertions(+), 83 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fa7985c0..8089822c5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,95 +1,68 @@ -# Contribution Guide +# Contributor's Guide -We're very excited that you're interested in contributing to Talk! There is much to do. Before you begin, please review this document to get a sense of the practices and philosophies that hold this project together. +Welcome! We are very excited that you are interested in contributing to Talk. + +This document is a companion to help you approach contributing. If it does not do so, please [let us know how we can improve it](https://github.com/coralproject/talk/issues)! + +What would you like to do? + +## Contribute to the documentation +Clear docs are a prerequisite for a successful open source project. We value non-code and code contributions equally. + +We are looking for _documentarians_ to: + +* make clarity, grammar and completenes updates, +* create new / missing sections, and +* take the lead in making sections, or the over all structure better. + +### But how? + +* Our public docs site can be updated [here](https://github.com/coralproject/docs). +* [Let us know](https://github.com/coralproject/talk/wiki/Contact-Us) if you'd like permission to update our wiki. +* Update any of our .md docs files by following [this guide](https://github.com/coralproject/talk/wiki/Forking,-Branching-and-Merging). +* Our API docs need to be kept honest. [Update them here](https://github.com/coralproject/talk/blob/master/docs/swagger.yaml). + +## Integrate into your environment + +Talk is designed to integrate into existing environments in a variety of ways: + +* [Auth integrations](https://github.com/coralproject/talk/wiki/Security#authentication-strategies) +* [Push assets into Talk](https://github.com/coralproject/talk/blob/master/routes/api/assets/index.js) +* Monitoring Hooks (coming in 2017) + +If you're considering deploying Talk, [please let us know](https://github.com/coralproject/talk/wiki/Contact-Us)! We are quite literally doing this for you and want to help you succeed any way we can. + +If you are writing custom integration code in your fork of Talk, please consider keeping it generic and filing a Pull Request to contribute it back to the project! See our [forking and merging guidelines](https://github.com/coralproject/talk/wiki/Forking,-Branching-and-Merging) for more info. + +## Write some code + +### Build a New Feature / Plugin + +Talk is beginning life as a Commenting Platform, but is architected to support many varieties of community engagement. + +Please [contact us](https://github.com/coralproject/talk/wiki/Contact-Us) early and often if you'd like to help. We would love to hear your ideas for features and plugins and help you find a way to productively engage the project. + +To get an idea of where the Coral Team is going, see: + +* our [product/design Trello board](https://trello.com/b/ILND751a/talk), +* our [current stories](https://www.pivotaltracker.com/n/projects/1863625), and +* our [issues](https://github.com/coralproject/talk/issues). -## Doing the Work +Examples: -We are here to make it as seamless as possible to contribute to Talk. The following lists are meant to make it straightforward to perform the mechanics of working on the project so you can focus your energy toward writing and reviewing content. +* [Add An Emoji Button to Comments](https://github.com/coralproject/talk/wiki/Add-An-Emoji-Button-to-Comments) -### Code Reviews +### Work on the Core -One of the most valuable aspects of working in software. It is something that should challenge the reviewer and author alike. It is a way of focusing knowledge, experience and opinions for the benefit of the project and the participants. +There is always more work to be done to make an application more stable, scaleable and secure. -Code reviews are a collaboration to make _the work_ as good as it can be. Code reviews are not a good venue for providing direct instruction to _the author._ Focus on positive, incremental improvements that can be made on the work at hand. +If you see issues in the code or have ideas on how we may improve Talk, please conisder: -Please take your time when writing and reviewing code. Here are some fundamental questions to open up a reviewing headspace. - -**Is the code clear, efficient and a pleasure to read?** - -Somewhere at the intersection of good variable names, well laid out file structures, consistent formatting and appropriate comments lies beautiful code. Code is language spoken to at least two very distinct audiences, the computer that interprets it and the developer who encounters it. Both should be at the front of your mind when reviewing code. - -Thinking like a computer, you could ask: - -* Is the code using memory efficiently? -* Is data being moved around unnecessarily? -* Are multiple network requests being made where fewer would do? -* Is there excess processing happening in a synchronous flow that may disrupt user experience? -* Are there large libraries included for small gains? - -Then, returning to your human roots... Is the code readable? - -* Can I understand what is happening here (and maybe even why) by simply opening up the file, starting at the top and reading downward? -* Do comments convey clear, full thoughts in a narrative language that provides background for the code choices? -* Are the files separated logically such that each one contains a clear concept of code? +* [contributing a fix](https://github.com/coralproject/talk/wiki/Forking,-Branching-and-Merging), +* [filing an issue](https://github.com/coralproject/talk/issues), or +* or otherwise [letting us know](https://github.com/coralproject/talk/wiki/Contact-Us). -**Is the API documentation up to date? Are all client calls written against the docs?** -We use [swagger](https://github.com/coralproject/talk/blob/master/swagger.yaml) to track our API documentation. - -* If APIs are created or updated, is the swagger.yml file up to date? There's nothing more frustrating than trying to develop against docs that are out of date or wrong. We need to be meticulous here as it's the little differences that can cause the most frustration and tricky bugs. -* If client code calls APIs, are they written against the swagger.yml file? Are all return codes handled? - -**Is there sufficient test coverage?** - -Our tests folder is set up to mirror the code folders: [https://github.com/coralproject/talk/tree/master/tests](https://github.com/coralproject/talk/tree/master/tests) - -* Can you a sense of the logic behind the code by reading the tests? -* Can you see both what should happen and what should _never, ever_ be allowed to happen? -* Are there future cases that are guarded against via the creation of unit tests (aka, making sure things are typed, specifically checking for all values that will be used, etc...)? - - -### Forking, Branching and Merging - -Talk follows the _master as tip_ repo structure. `master` is the bleeding edge. It should be _as stable as possible_ but may suffer instabilities, generally during times that fundamental architectural elements are added. - -Releases are _tagged_ off the master branch. - -Contributions to Talk follow this process. There are a lot of steps, but mechanically following these steps will standardize communication, help stop errors and let you focus on your contribution. - -* At the outset of a piece of work, a branch or fork is made from master. -* The work is done in that fork. -* As soon as the work has taken shape, a PR is created for discussion. (If the PR is created for review before it's ready to merge, please make that clear in the description/title.) -* At least one other contributor to the project must review all code (see Code Reviews below.) -* If there are merge conflicts with master, merge master into the branch. -* Ensure that [circleci](https://circleci.com/) passes all tests for your branch. (If you have forked and do not have circleci set up, you and the reviewer should independently ensure that all the of Continuous Integration steps pass before merging.) -* If merge conflicts exist with `master`, merge `master` into your branch and re-run CI before merging into master. -* Merge to master, but _you're not quite done yet!_ -* Deploy master to staging (or have a core member do so.) -* Ensure that all your changes are working on staging. -* Have your reviewer verify the same. -* ... aaaand the work is delivered! - - -## Continuous Integration - -We use circleci to run our ci: [https://circleci.com/gh/coralproject/talk](https://circleci.com/gh/coralproject/talk) - -Our pipeline will _test_, _lint_, and _build_ all pushes to the repo. - -Any branch not passing CI will not be merged into master. - -If you're working in a fork, please run each of the steps locally before submitting a PR. - - -## Coding Style - -### API Design - -When building APIs, we follow these principles: - -* Follow [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) principles for basic operations. -* Avoid routing yourself into a corner, for example, by putting a variable other than an object's id directly after an object. -* Put non-required, flexible variables into query params, required/identity based values in request params. From 0219f1916e9a4db0961fa6ae5b8cf1c6b9287401 Mon Sep 17 00:00:00 2001 From: David Erwin Date: Tue, 27 Dec 2016 10:59:08 -0500 Subject: [PATCH 05/11] Link contributing.md from readme.md --- CONTRIBUTING.md | 8 +++++++- README.md | 6 +----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8089822c5..3e4bfbb56 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,13 @@ Welcome! We are very excited that you are interested in contributing to Talk. This document is a companion to help you approach contributing. If it does not do so, please [let us know how we can improve it](https://github.com/coralproject/talk/issues)! -What would you like to do? + +## Product Roadmap + +You can view what the Coral Team is working on next here https://www.pivotaltracker.com/n/projects/1863625. + +You can view product ideas and our longer term roadmap here https://trello.com/b/ILND751a/talk. + ## Contribute to the documentation Clear docs are a prerequisite for a successful open source project. We value non-code and code contributions equally. diff --git a/README.md b/README.md index 3b258736f..cfa8bea95 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,7 @@ A commenting platform from [The Coral Project](https://coralproject.net). ## Contributing to Talk -### Product Roadmap - -You can view what the Coral Team is working on next here https://www.pivotaltracker.com/n/projects/1863625. - -You can view product ideas and our longer term roadmap here https://trello.com/b/ILND751a/talk. +See our [Contribution Guide](https://github.com/coralproject/talk/blob/master/CONTRIBUTING.md)! ## Usage From da37bb32f138a53bef882378c392ba23a1877e9a Mon Sep 17 00:00:00 2001 From: David Erwin Date: Tue, 27 Dec 2016 11:28:01 -0500 Subject: [PATCH 06/11] Updating for style and completeness --- INSTALL.md | 74 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 21 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 623e48ffc..faee7bb25 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,59 +1,85 @@ -# BUILDING FROM SOURCE +# Installing a dev environment By contributing to this project you agree to the [Code of Conduct](https://coralproject.net/code-of-conduct.html). ## Requirements -* [Node](https://nodejs.org/es/download/package-manager) -* Mongo -* Redis +### System -### Operating System - -- We recommend hosting [Talk](https://github.com/coralproject/talk) with any flavor of Linux +- Any flavor of Linux, OSX or Windows - 1GB memory (minimum) - 5GB storage (minimum) -## Initial Setup +### Software -### Get the code +* [Node](https://nodejs.org/es/download/package-manager) v7 or later +* Mongo v3.2 or later +* Redis v3.2 or later -Clone the repository: +_Please be sure to check the versions of these requirements. Insufficient versions of these may lead to unexpected errors!_ -` -git clone https://github.com/coralproject/talk -` +## First time setup ### Installation -* cd talk -* npm install +Navigate to a directory. + +``` +git clone https://github.com/coralproject/talk +cd talk +npm install +``` ### Environmental Variables -This project is using many environmental variables for configuration. You can learn about them in the [README's file](README.md). +Talk uses environmental variables for configuration. You can learn about them in the [README file](README.md). -### Local development -` +## Workflows + +### The server + +Starting the server: + +``` npm start -` +``` -It will run in http://localhost:$PORT +Browse to `http://localhost:3000` (or your custom port.) + +### Building the front end + +Our build process will build all front end components registered [here](https://github.com/coralproject/talk/blob/6052cac1d3494f8060325a88bb2ce03c88c2f94c/webpack.config.dev.js#L9-L15). + +One time build: + +``` +npm build +``` + +Build, then rebuild when a file is updated (development build): + +``` +npm build-watch +``` ### Testing -Run all tests once via: +Run all tests once: ` npm test ` +Run our end to end tests (will install Selenium and nightwatch): + ` npm run e2e ` +_Please ensure all tests are passing before submitting a PR!_ + ## Troubleshooting @@ -61,3 +87,9 @@ npm run e2e - Check that Redis Server is running. - Check that TALK_REDIS_URL is set. + +##### Authenticaiton doesn't work! + +- Make sure Redis is the correct version. + + From c86148c0f10eb098165346f8cd192243620ef5ac Mon Sep 17 00:00:00 2001 From: David Erwin Date: Tue, 27 Dec 2016 11:39:54 -0500 Subject: [PATCH 07/11] Add links to INSTALL.md --- CONTRIBUTING.md | 4 ++++ README.md | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e4bfbb56..69765d662 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,6 +30,8 @@ We are looking for _documentarians_ to: ## Integrate into your environment +First, [set up a dev environment](https://github.com/coralproject/talk/blob/master/INSTALL.md). Please let us know how this goes! + Talk is designed to integrate into existing environments in a variety of ways: * [Auth integrations](https://github.com/coralproject/talk/wiki/Security#authentication-strategies) @@ -42,6 +44,8 @@ If you are writing custom integration code in your fork of Talk, please consider ## Write some code +First, [set up a dev environment](https://github.com/coralproject/talk/blob/master/INSTALL.md). Please let us know how this goes! + ### Build a New Feature / Plugin Talk is beginning life as a Commenting Platform, but is architected to support many varieties of community engagement. diff --git a/README.md b/README.md index cfa8bea95..6c331c115 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,13 @@ See our [Contribution Guide](https://github.com/coralproject/talk/blob/master/CO ## Usage +### Installation + +To set up a development environment or build from source, see [INSTALL.md](https://github.com/coralproject/talk/blob/master/INSTALL.md). + +To launch a Talk server of your own from your browser without any need to muck about in a terminal or think about engineering concepts, stay tuned. We will launch [our installer](https://github.com/coralproject/talk-install) shortly!! + + ### Configuration The Talk application requires specific configuration options to be available From 9a608fd02e519ac475e5a80ea5da2bf49c90bffe Mon Sep 17 00:00:00 2001 From: David Erwin Date: Tue, 27 Dec 2016 11:50:34 -0500 Subject: [PATCH 08/11] Spell stuff right and clean up --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 69765d662..66ae8ade8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ Clear docs are a prerequisite for a successful open source project. We value non We are looking for _documentarians_ to: -* make clarity, grammar and completenes updates, +* make clarity, grammar and completeness updates, * create new / missing sections, and * take the lead in making sections, or the over all structure better. @@ -68,7 +68,7 @@ Examples: There is always more work to be done to make an application more stable, scaleable and secure. -If you see issues in the code or have ideas on how we may improve Talk, please conisder: +If you see issues in the code or have ideas on how we may improve Talk, please consider: * [contributing a fix](https://github.com/coralproject/talk/wiki/Forking,-Branching-and-Merging), * [filing an issue](https://github.com/coralproject/talk/issues), or From a02ad695683bcde2c4b78b4a9f3d9935be975f57 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 3 Jan 2017 09:36:20 -0300 Subject: [PATCH 09/11] Adds specific fields to the metadata in the action when flagging because suspect word. --- routes/api/comments/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/api/comments/index.js b/routes/api/comments/index.js index 39b4b02bc..21426d217 100644 --- a/routes/api/comments/index.js +++ b/routes/api/comments/index.js @@ -137,7 +137,7 @@ router.post('/', wordlist.filter('body'), (req, res, next) => { .then((comment) => { if (req.wordlist.suspect) { return Comment - .addAction(comment.id, null, 'flag', 'body', 'Matched suspect word filters.') + .addAction(comment.id, null, 'flag', {field: 'body', details: 'Matched suspect word filters.'}) .then(() => comment); } From 5c6df6d48145dabd040d06e2d2b0ebc87a7e9289 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 3 Jan 2017 09:37:02 -0300 Subject: [PATCH 10/11] Fix tests when flagging because suspect word. --- tests/routes/api/comments/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/routes/api/comments/index.js b/tests/routes/api/comments/index.js index 1c782e405..3af37cada 100644 --- a/tests/routes/api/comments/index.js +++ b/tests/routes/api/comments/index.js @@ -225,8 +225,9 @@ describe('/api/v1/comments', () => { let action = actions[0]; expect(action).to.have.property('item_id', comment.id); - expect(action).to.have.property('field', 'body'); - expect(action).to.have.property('detail', 'Matched suspect word filters.'); + expect(action).to.have.property('metadata'); + expect(action.metadata).to.have.property('field', 'body'); + expect(action.metadata).to.have.property('details', 'Matched suspect word filters.'); }); }); From 759e74a88d26c5212fd354e0c8f9d7be3c6d47a3 Mon Sep 17 00:00:00 2001 From: Dan Zajdband Date: Tue, 3 Jan 2017 10:46:55 -0300 Subject: [PATCH 11/11] coral-admin: Fixed check for component unmount removing a listener when there is no object --- client/coral-admin/src/components/CommentList.js | 4 +--- client/coral-ui/components/Dialog.js | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/coral-admin/src/components/CommentList.js b/client/coral-admin/src/components/CommentList.js index 326d63cf1..a1a990490 100644 --- a/client/coral-admin/src/components/CommentList.js +++ b/client/coral-admin/src/components/CommentList.js @@ -25,9 +25,7 @@ export default class CommentList extends React.Component { loading: PropTypes.bool, // list of actions (flags, etc) associated with the comments - actions: PropTypes.shape({ - ids: PropTypes.arrayOf(PropTypes.string) - }), + actions: PropTypes.arrayOf(PropTypes.string), suspectWords: PropTypes.arrayOf(PropTypes.string) } diff --git a/client/coral-ui/components/Dialog.js b/client/coral-ui/components/Dialog.js index 9af9be6dd..17cb78d28 100644 --- a/client/coral-ui/components/Dialog.js +++ b/client/coral-ui/components/Dialog.js @@ -42,7 +42,9 @@ export default class Dialog extends Component { componentWillUnmount() { const dialog = this.dialog; - dialog.removeEventListener('cancel', this.props.onCancel); + if (dialog) { + dialog.removeEventListener('cancel', this.props.onCancel); + } } render() {