From 6518705a3aaba0edbeb2dc5a0c093a2d71b6b182 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Wed, 3 Oct 2018 19:19:14 -0700 Subject: [PATCH] ref(integrations): Allow specifying url params for addIntegration --- .../views/organizationIntegrations/addIntegration.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.jsx b/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.jsx index 064460d8c552f7..65c39085a463fb 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.jsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.jsx @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; +import queryString from 'query-string'; import {t} from 'app/locale'; import IndicatorStore from 'app/stores/indicatorStore'; @@ -45,14 +46,18 @@ export default class AddIntegration extends React.Component { return {left, top}; } - openDialog = () => { + openDialog = urlParams => { const name = 'sentryAddIntegration'; const {url, width, height} = this.props.provider.setupDialog; - const {reinstallId} = this.props; const {left, top} = this.computeCenteredWindow(width, height); - const installUrl = reinstallId ? url + `?reinstall_id=${reinstallId}` : url; + const query = {...urlParams}; + if (this.props.reinstallId) { + query.reinstall_id = this.props.reinstallId; + } + + const installUrl = `${url}?${queryString.stringify(query)}`; const opts = `scrollbars=yes,width=${width},height=${height},top=${top},left=${left}`; this.dialog = window.open(installUrl, name, opts);