From 44c83be47882f09552fd96ec4057fdd61be1777c Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 19 Jul 2019 21:08:36 +0300 Subject: [PATCH 1/2] fix(InstallWizard): Fix exception when InstallWizard completed Since we don't have tests for the submit flow, we did not catch a regression from #13798 where the event handler was not bound to the class instance, causing an `this.setState` is not defined error when submitting the welcome form. This patch fixes the issue. Will add tests to cover this soon after. --- src/sentry/static/sentry/app/views/app.jsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/sentry/static/sentry/app/views/app.jsx b/src/sentry/static/sentry/app/views/app.jsx index 6bdc989ca58acb..e7799043280d24 100644 --- a/src/sentry/static/sentry/app/views/app.jsx +++ b/src/sentry/static/sentry/app/views/app.jsx @@ -200,16 +200,13 @@ class App extends React.Component { e.stopPropagation(); } - onConfigured() { - this.setState({needsUpgrade: false}); + onConfigured = () => this.setState({needsUpgrade: false}; } - handleNewsletterConsent = () => { - // this is somewhat hackish - this.setState({ - newsletterConsentPrompt: false, - }); - }; + // this is somewhat hackish + handleNewsletterConsent = () => this.setState({ + newsletterConsentPrompt: false, + }); handleGlobalModalClose = () => { if (!this.mainContainerRef) { From ac4bd7e404f05315747e4b316b327f22ab714809 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 19 Jul 2019 21:17:21 +0300 Subject: [PATCH 2/2] write valid code, I must --- src/sentry/static/sentry/app/views/app.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sentry/static/sentry/app/views/app.jsx b/src/sentry/static/sentry/app/views/app.jsx index e7799043280d24..e2e3611f7054ad 100644 --- a/src/sentry/static/sentry/app/views/app.jsx +++ b/src/sentry/static/sentry/app/views/app.jsx @@ -200,13 +200,13 @@ class App extends React.Component { e.stopPropagation(); } - onConfigured = () => this.setState({needsUpgrade: false}; - } + onConfigured = () => this.setState({needsUpgrade: false}); // this is somewhat hackish - handleNewsletterConsent = () => this.setState({ - newsletterConsentPrompt: false, - }); + handleNewsletterConsent = () => + this.setState({ + newsletterConsentPrompt: false, + }); handleGlobalModalClose = () => { if (!this.mainContainerRef) {