From b65e4960a5baa4d704398849b4e3b46e84ac9e29 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 29 May 2017 17:39:03 +0100 Subject: [PATCH] move Dialog analytics to Modal controller mark title as required, it sorta is, why isn't this based on BaseDialog? Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/Modal.js | 2 ++ src/components/views/dialogs/BaseDialog.js | 2 -- src/components/views/dialogs/ChatInviteDialog.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Modal.js b/src/Modal.js index 7be37da92e..38bcfad448 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -19,6 +19,7 @@ limitations under the License. var React = require('react'); var ReactDOM = require('react-dom'); +import Analytics from './Analytics'; import sdk from './index'; const DIALOG_CONTAINER_ID = "mx_Dialog_Container"; @@ -104,6 +105,7 @@ class ModalManager { } createDialog(Element, props, className) { + Analytics.trackEvent('Modal', props.title, 'createDialog'); return this.createDialogAsync((cb) => {cb(Element);}, props, className); } diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index f2ea4eda95..295bb21ea1 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -16,7 +16,6 @@ limitations under the License. import React from 'react'; -import Analytics from '../../../Analytics'; import * as KeyCode from '../../../KeyCode'; import AccessibleButton from '../elements/AccessibleButton'; import sdk from '../../../index'; @@ -67,7 +66,6 @@ export default React.createClass({ }, render: function() { - Analytics.trackEvent('Dialog', this.props.title, 'mount'); const TintableSvg = sdk.getComponent("elements.TintableSvg"); return ( diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index ca0f10bc6b..6f2bbbba82 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -34,7 +34,7 @@ const TRUNCATE_QUERY_LIST = 40; module.exports = React.createClass({ displayName: "ChatInviteDialog", propTypes: { - title: React.PropTypes.string, + title: React.PropTypes.string.isRequired, description: React.PropTypes.oneOfType([ React.PropTypes.element, React.PropTypes.string,