Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
647e4d38
Commit
647e4d38
authored
Oct 07, 2020
by
David O'Regan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instrument snowplow count of integrations list
parent
b18cdc7a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
2 deletions
+35
-2
app/assets/javascripts/alerts_settings/components/alerts_integrations_list.vue
...s/alerts_settings/components/alerts_integrations_list.vue
+11
-0
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
...ripts/alerts_settings/components/alerts_settings_form.vue
+0
-2
app/assets/javascripts/alerts_settings/constants.js
app/assets/javascripts/alerts_settings/constants.js
+10
-0
spec/frontend/alert_settings/alerts_integrations_list_spec.js
.../frontend/alert_settings/alerts_integrations_list_spec.js
+14
-0
No files found.
app/assets/javascripts/alerts_settings/components/alerts_integrations_list.vue
View file @
647e4d38
<
script
>
import
{
GlTable
,
GlIcon
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
Tracking
from
'
~/tracking
'
;
import
{
trackAlertIntergrationsViewsOptions
}
from
'
../constants
'
;
export
const
i18n
=
{
title
:
s__
(
'
AlertsIntegrations|Current integrations
'
),
...
...
@@ -57,6 +59,15 @@ export default {
};
},
},
mounted
()
{
this
.
trackPageViews
();
},
methods
:
{
trackPageViews
()
{
const
{
category
,
action
}
=
trackAlertIntergrationsViewsOptions
;
Tracking
.
event
(
category
,
action
);
},
},
};
</
script
>
...
...
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
View file @
647e4d38
...
...
@@ -16,7 +16,6 @@ import {
import
{
debounce
}
from
'
lodash
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
doesHashExistInUrl
}
from
'
~/lib/utils/url_utility
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
import
ToggleButton
from
'
~/vue_shared/components/toggle_button.vue
'
;
import
IntegrationsList
from
'
./alerts_integrations_list.vue
'
;
...
...
@@ -56,7 +55,6 @@ export default {
directives
:
{
'
gl-modal
'
:
GlModalDirective
,
},
mixins
:
[
glFeatureFlagsMixin
()],
inject
:
[
'
prometheus
'
,
'
generic
'
,
'
opsgenie
'
],
data
()
{
return
{
...
...
app/assets/javascripts/alerts_settings/constants.js
View file @
647e4d38
...
...
@@ -51,3 +51,13 @@ export const targetPrometheusUrlPlaceholder = 'http://prometheus.example.com/';
export
const
targetOpsgenieUrlPlaceholder
=
'
https://app.opsgenie.com/alert/list/
'
;
export
const
sectionHash
=
'
js-alert-management-settings
'
;
/* eslint-disable @gitlab/require-i18n-strings */
/**
* Tracks snowplow event when user views alerts intergration list
*/
export
const
trackAlertIntergrationsViewsOptions
=
{
category
:
'
Alert Intergrations
'
,
action
:
'
view_alert_integrations_list
'
,
};
spec/frontend/alert_settings/alerts_integrations_list_spec.js
View file @
647e4d38
import
{
GlTable
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Tracking
from
'
~/tracking
'
;
import
AlertIntegrationsList
,
{
i18n
,
}
from
'
~/alerts_settings/components/alerts_integrations_list.vue
'
;
import
{
trackAlertIntergrationsViewsOptions
}
from
'
~/alerts_settings/constants
'
;
const
mockIntegrations
=
[
{
...
...
@@ -72,4 +74,16 @@ describe('AlertIntegrationsList', () => {
expect
(
notActivatedIcon
.
attributes
(
'
title
'
)).
toBe
(
i18n
.
status
.
disabled
.
tooltip
);
});
});
describe
(
'
Snowplow tracking
'
,
()
=>
{
beforeEach
(()
=>
{
jest
.
spyOn
(
Tracking
,
'
event
'
);
mountComponent
();
});
it
(
'
should track alert list page views
'
,
()
=>
{
const
{
category
,
action
}
=
trackAlertIntergrationsViewsOptions
;
expect
(
Tracking
.
event
).
toHaveBeenCalledWith
(
category
,
action
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment