|
@@ -13,6 +13,7 @@ import MemberListStore from 'sentry/stores/memberListStore';
|
|
|
import ProjectsStore from 'sentry/stores/projectsStore';
|
|
|
import {Organization, Project, Team} from 'sentry/types';
|
|
|
import {defined} from 'sentry/utils';
|
|
|
+import {trackIntegrationAnalytics} from 'sentry/utils/integrationUtil';
|
|
|
|
|
|
import RuleBuilder from './ruleBuilder';
|
|
|
|
|
@@ -27,6 +28,10 @@ type Props = {
|
|
|
initialText: string;
|
|
|
onCancel: () => void;
|
|
|
organization: Organization;
|
|
|
+ /**
|
|
|
+ * Used for analytics
|
|
|
+ */
|
|
|
+ page: 'issue_details' | 'project_settings';
|
|
|
project: Project;
|
|
|
onSave?: (text: string | null) => void;
|
|
|
} & typeof defaultProps;
|
|
@@ -63,7 +68,7 @@ class OwnerInput extends Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
handleUpdateOwnership = () => {
|
|
|
- const {organization, project, onSave} = this.props;
|
|
|
+ const {organization, project, onSave, page, initialText} = this.props;
|
|
|
const {text} = this.state;
|
|
|
this.setState({error: null});
|
|
|
|
|
@@ -86,6 +91,13 @@ class OwnerInput extends Component<Props, State> {
|
|
|
},
|
|
|
() => onSave && onSave(text)
|
|
|
);
|
|
|
+ trackIntegrationAnalytics('project_ownership.saved', {
|
|
|
+ page,
|
|
|
+ organization,
|
|
|
+ net_change:
|
|
|
+ (text?.split('\n').filter(x => x).length ?? 0) -
|
|
|
+ initialText.split('\n').filter(x => x).length,
|
|
|
+ });
|
|
|
})
|
|
|
.catch(error => {
|
|
|
this.setState({error: error.responseJSON});
|