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
0c774e86
Commit
0c774e86
authored
Apr 20, 2021
by
Matthias van de Meent
Committed by
Mayra Cabrera
Apr 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Cohorts limit by dropping false dependency on Usage Ping
parent
ad555aa8
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
107 deletions
+13
-107
app/assets/javascripts/admin/users/components/usage_ping_disabled.vue
...avascripts/admin/users/components/usage_ping_disabled.vue
+0
-48
app/assets/javascripts/admin/users/index.js
app/assets/javascripts/admin/users/index.js
+0
-21
app/assets/javascripts/pages/admin/users/index.js
app/assets/javascripts/pages/admin/users/index.js
+1
-2
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+4
-6
app/views/admin/users/_cohorts.html.haml
app/views/admin/users/_cohorts.html.haml
+1
-4
doc/user/admin_area/user_cohorts.md
doc/user/admin_area/user_cohorts.md
+1
-2
ee/spec/views/admin/users/index.html.haml_spec.rb
ee/spec/views/admin/users/index.html.haml_spec.rb
+1
-0
locale/gitlab.pot
locale/gitlab.pot
+0
-6
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+5
-18
No files found.
app/assets/javascripts/admin/users/components/usage_ping_disabled.vue
deleted
100644 → 0
View file @
ad555aa8
<
script
>
import
{
GlEmptyState
,
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlEmptyState
,
GlSprintf
,
GlLink
,
},
inject
:
{
svgPath
:
{
default
:
''
,
},
docsLink
:
{
default
:
''
,
},
primaryButtonPath
:
{
default
:
''
,
},
},
};
</
script
>
<
template
>
<gl-empty-state
class=
"js-empty-state"
:title=
"__('Activate user activity analysis')"
:svg-path=
"svgPath"
:primary-button-text=
"__('Turn on usage ping')"
:primary-button-link=
"primaryButtonPath"
>
<template
#description
>
<gl-sprintf
:message=
"
__(
'Turn on %
{strongStart}usage ping%{strongEnd} to activate analysis of user activity, known as %{docLinkStart}Cohorts%{docLinkEnd}.',
)
"
>
<template
#docLink
="
{ content }">
<gl-link
:href=
"docsLink"
target=
"_blank"
>
{{
content
}}
</gl-link>
</
template
>
<
template
#strong=
"{ content }"
><strong>
{{
content
}}
</strong></
template
>
</gl-sprintf>
</template>
</gl-empty-state>
</template>
app/assets/javascripts/admin/users/index.js
View file @
0c774e86
import
Vue
from
'
vue
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
AdminUsersApp
from
'
./components/app.vue
'
;
import
UsagePingDisabled
from
'
./components/usage_ping_disabled.vue
'
;
export
const
initAdminUsersApp
=
(
el
=
document
.
querySelector
(
'
#js-admin-users-app
'
))
=>
{
if
(
!
el
)
{
...
...
@@ -21,23 +20,3 @@ export const initAdminUsersApp = (el = document.querySelector('#js-admin-users-a
}),
});
};
export
const
initCohortsEmptyState
=
(
el
=
document
.
querySelector
(
'
#js-cohorts-empty-state
'
))
=>
{
if
(
!
el
)
{
return
false
;
}
const
{
emptyStateSvgPath
,
enableUsagePingLink
,
docsLink
}
=
el
.
dataset
;
return
new
Vue
({
el
,
provide
:
{
svgPath
:
emptyStateSvgPath
,
primaryButtonPath
:
enableUsagePingLink
,
docsLink
,
},
render
(
h
)
{
return
h
(
UsagePingDisabled
);
},
});
};
app/assets/javascripts/pages/admin/users/index.js
View file @
0c774e86
import
Vue
from
'
vue
'
;
import
{
initAdminUsersApp
,
initCohortsEmptyState
}
from
'
~/admin/users
'
;
import
{
initAdminUsersApp
}
from
'
~/admin/users
'
;
import
initTabs
from
'
~/admin/users/tabs
'
;
import
initConfirmModal
from
'
~/confirm_modal
'
;
import
csrf
from
'
~/lib/utils/csrf
'
;
...
...
@@ -62,6 +62,5 @@ document.addEventListener('DOMContentLoaded', () => {
});
initConfirmModal
();
initCohortsEmptyState
();
initTabs
();
});
app/controllers/admin/users_controller.rb
View file @
0c774e86
...
...
@@ -318,13 +318,11 @@ class Admin::UsersController < Admin::ApplicationController
end
def
load_cohorts
if
Gitlab
::
CurrentSettings
.
usage_ping_enabled
cohorts_results
=
Rails
.
cache
.
fetch
(
'cohorts'
,
expires_in:
1
.
day
)
do
CohortsService
.
new
.
execute
end
CohortsSerializer
.
new
.
represent
(
cohorts_results
)
cohorts_results
=
Rails
.
cache
.
fetch
(
'cohorts'
,
expires_in:
1
.
day
)
do
CohortsService
.
new
.
execute
end
CohortsSerializer
.
new
.
represent
(
cohorts_results
)
end
def
track_cohorts_visit
...
...
app/views/admin/users/_cohorts.html.haml
View file @
0c774e86
-
if
@cohorts
=
render
'cohorts_table'
-
else
#js-cohorts-empty-state
{
data:
{
empty_state_svg_path:
image_path
(
'illustrations/convdev/convdev_no_index.svg'
),
enable_usage_ping_link:
metrics_and_profiling_admin_application_settings_path
(
anchor:
'js-usage-settings'
),
docs_link:
help_page_path
(
'user/admin_area/analytics/user_cohorts'
)
}
}
=
render
'cohorts_table'
doc/user/admin_area/user_cohorts.md
View file @
0c774e86
...
...
@@ -6,8 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Cohorts **(FREE)**
As a benefit of having the
[
usage ping active
](
settings/usage_statistics.md
)
,
you can analyze your users' GitLab activities over time.
You can analyze your users' GitLab activities over time.
To see user cohorts, go to
**Admin Area > Overview > Users**
.
...
...
ee/spec/views/admin/users/index.html.haml_spec.rb
View file @
0c774e86
...
...
@@ -11,6 +11,7 @@ RSpec.describe 'admin/users/index' do
allow
(
view
).
to
receive
(
:container_class
).
and_return
(
'ignored'
)
create
(
:user
)
# to have at least one usser
assign
(
:users
,
User
.
all
.
page
(
1
))
assign
(
:cohorts
,
{
months_included:
0
,
cohorts:
[]
})
render
end
...
...
locale/gitlab.pot
View file @
0c774e86
...
...
@@ -1796,9 +1796,6 @@ msgstr ""
msgid "Activate Service Desk"
msgstr ""
msgid "Activate user activity analysis"
msgstr ""
msgid "Active"
msgstr ""
...
...
@@ -33336,9 +33333,6 @@ msgstr ""
msgid "Turn on"
msgstr ""
msgid "Turn on %{strongStart}usage ping%{strongEnd} to activate analysis of user activity, known as %{docLinkStart}Cohorts%{docLinkEnd}."
msgstr ""
msgid "Turn on usage ping"
msgstr ""
...
...
spec/features/admin/admin_users_spec.rb
View file @
0c774e86
...
...
@@ -44,27 +44,14 @@ RSpec.describe "Admin::Users" do
end
describe
'Cohorts tab content'
do
context
'with usage ping enabled'
do
it
'shows users count per month'
do
stub_application_setting
(
usage_ping_enabled:
true
)
it
'shows users count per month'
do
stub_application_setting
(
usage_ping_enabled:
false
)
create_list
(
:user
,
2
)
create_list
(
:user
,
2
)
visit
admin_users_path
(
tab:
'cohorts'
)
expect
(
page
).
to
have_content
(
"
#{
Time
.
now
.
strftime
(
'%b %Y'
)
}
3 0"
)
end
end
context
'with usage ping disabled'
do
it
'shows empty state'
,
:js
do
stub_application_setting
(
usage_ping_enabled:
false
)
visit
admin_users_path
(
tab:
'cohorts'
)
visit
admin_users_path
(
tab:
'cohorts'
)
expect
(
page
).
to
have_selector
(
".js-empty-state"
)
expect
(
page
).
to
have_content
(
"Activate user activity analysis"
)
end
expect
(
page
).
to
have_content
(
"
#{
Time
.
now
.
strftime
(
'%b %Y'
)
}
3 0"
)
end
end
end
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