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
e978b11e
Commit
e978b11e
authored
May 03, 2019
by
Enrique Alcántara
Committed by
Filipa Lacerda
May 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track clicks on "uninstall" button for kubernetes implementation
parent
a076a1dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
4 deletions
+59
-4
app/assets/javascripts/clusters/components/uninstall_application_confirmation_modal.vue
...s/components/uninstall_application_confirmation_modal.vue
+9
-1
app/assets/javascripts/clusters/mixins/track_uninstall_button_click.js
...vascripts/clusters/mixins/track_uninstall_button_click.js
+5
-0
ee/app/assets/javascripts/clusters/mixins/track_uninstall_button_click.js
...vascripts/clusters/mixins/track_uninstall_button_click.js
+11
-0
ee/changelogs/unreleased/10763-track-uninstall-button-clicks.yml
...gelogs/unreleased/10763-track-uninstall-button-clicks.yml
+5
-0
ee/spec/frontend/clusters/mixins/track_uninstall_button_click_spec.js
...tend/clusters/mixins/track_uninstall_button_click_spec.js
+17
-0
spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js
...mponents/uninstall_application_confirmation_modal_spec.js
+12
-3
No files found.
app/assets/javascripts/clusters/components/uninstall_application_confirmation_modal.vue
View file @
e978b11e
<
script
>
import
{
GlModal
}
from
'
@gitlab/ui
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
import
trackUninstallButtonClickMixin
from
'
ee_else_ce/clusters/mixins/track_uninstall_button_click
'
;
import
{
INGRESS
,
CERT_MANAGER
,
PROMETHEUS
,
RUNNER
,
KNATIVE
,
JUPYTER
}
from
'
../constants
'
;
const
CUSTOM_APP_WARNING_TEXT
=
{
...
...
@@ -20,6 +21,7 @@ export default {
components
:
{
GlModal
,
},
mixins
:
[
trackUninstallButtonClickMixin
],
props
:
{
application
:
{
type
:
String
,
...
...
@@ -51,6 +53,12 @@ export default {
return
`uninstall-
${
this
.
application
}
`
;
},
},
methods
:
{
confirmUninstall
()
{
this
.
trackUninstallButtonClick
(
this
.
application
);
this
.
$emit
(
'
confirm
'
);
},
},
};
</
script
>
<
template
>
...
...
@@ -60,7 +68,7 @@ export default {
:ok-title=
"title"
:modal-id=
"modalId"
:title=
"title"
@
ok=
"
$emit('confirm'
)"
@
ok=
"
confirmUninstall(
)"
>
{{
warningText
}}
{{
customAppWarningText
}}
</gl-modal
>
</
template
>
app/assets/javascripts/clusters/mixins/track_uninstall_button_click.js
0 → 100644
View file @
e978b11e
export
default
{
methods
:
{
trackUninstallButtonClick
:
()
=>
{},
},
};
ee/app/assets/javascripts/clusters/mixins/track_uninstall_button_click.js
0 → 100644
View file @
e978b11e
import
stats
from
'
ee/stats
'
;
export
default
{
methods
:
{
trackUninstallButtonClick
:
application
=>
{
stats
.
trackEvent
(
'
k8s_cluster
'
,
'
uninstall
'
,
{
label
:
application
,
});
},
},
};
ee/changelogs/unreleased/10763-track-uninstall-button-clicks.yml
0 → 100644
View file @
e978b11e
---
title
:
Track clicks on uninstall button for kubernetes implementation
merge_request
:
12048
author
:
type
:
added
ee/spec/frontend/clusters/mixins/track_uninstall_button_click_spec.js
0 → 100644
View file @
e978b11e
import
trackUninstallButtonClick
from
'
ee/clusters/mixins/track_uninstall_button_click
'
;
import
stats
from
'
ee/stats
'
;
jest
.
mock
(
'
ee/stats
'
);
describe
(
'
trackUninstallButtonClickMixin
'
,
()
=>
{
describe
(
'
trackUninstallButtonClick
'
,
()
=>
{
it
(
'
sends snowplow event indicating which application will be uninstalled
'
,
()
=>
{
const
application
=
'
ingress
'
;
trackUninstallButtonClick
.
methods
.
trackUninstallButtonClick
(
application
);
expect
(
stats
.
trackEvent
).
toHaveBeenCalledWith
(
'
k8s_cluster
'
,
'
uninstall
'
,
{
label
:
application
,
});
});
});
});
spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js
View file @
e978b11e
...
...
@@ -29,10 +29,19 @@ describe('UninstallApplicationConfirmationModal', () => {
expect
(
wrapper
.
find
(
GlModal
).
attributes
(
'
ok-title
'
)).
toEqual
(
`Uninstall
${
appTitle
}
`
);
});
it
(
'
triggers confirm event when ok button is clicked
'
,
()
=>
{
wrapper
.
find
(
GlModal
).
vm
.
$emit
(
'
ok
'
);
describe
(
'
when ok button is clicked
'
,
()
=>
{
beforeEach
(()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
trackUninstallButtonClick
'
);
wrapper
.
find
(
GlModal
).
vm
.
$emit
(
'
ok
'
);
});
it
(
'
emits confirm event
'
,
()
=>
{
expect
(
wrapper
.
emitted
(
'
confirm
'
)).
toBeTruthy
();
});
expect
(
wrapper
.
emitted
(
'
confirm
'
)).
toBeTruthy
();
it
(
'
calls track uninstall button click mixin
'
,
()
=>
{
expect
(
wrapper
.
vm
.
trackUninstallButtonClick
).
toHaveBeenCalledWith
(
INGRESS
);
});
});
it
(
'
displays a warning text indicating the app will be uninstalled
'
,
()
=>
{
...
...
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