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
64ae70c1
Commit
64ae70c1
authored
Jul 13, 2021
by
Axel Garcia
Committed by
Miguel Rincon
Jul 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use "Service Ping/Data" for the Usage Ping Disabled components
parent
11188b24
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
111 additions
and
40 deletions
+111
-40
app/assets/javascripts/analytics/devops_report/components/service_ping_disabled.vue
...lytics/devops_report/components/service_ping_disabled.vue
+14
-9
app/assets/javascripts/analytics/devops_report/devops_score_disabled_service_ping.js
...ytics/devops_report/devops_score_disabled_service_ping.js
+12
-6
app/assets/javascripts/pages/admin/dev_ops_report/index.js
app/assets/javascripts/pages/admin/dev_ops_report/index.js
+2
-2
app/views/admin/dev_ops_report/_report.html.haml
app/views/admin/dev_ops_report/_report.html.haml
+4
-5
ee/app/views/admin/dev_ops_report/_devops_tabs.html.haml
ee/app/views/admin/dev_ops_report/_devops_tabs.html.haml
+4
-4
ee/spec/features/admin/admin_dev_ops_report_spec.rb
ee/spec/features/admin/admin_dev_ops_report_spec.rb
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+12
-12
spec/features/admin/admin_dev_ops_report_spec.rb
spec/features/admin/admin_dev_ops_report_spec.rb
+1
-1
spec/frontend/analytics/devops_report/components/service_ping_disabled_spec.js
...cs/devops_report/components/service_ping_disabled_spec.js
+61
-0
No files found.
app/assets/javascripts/analytics/devops_report/components/
usag
e_ping_disabled.vue
→
app/assets/javascripts/analytics/devops_report/components/
servic
e_ping_disabled.vue
View file @
64ae70c1
...
@@ -25,28 +25,33 @@ export default {
...
@@ -25,28 +25,33 @@ export default {
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<gl-empty-state
class=
"js-empty-state"
:title=
"__('Usag
e ping is off')"
:svg-path=
"svgPath"
>
<gl-empty-state
:title=
"s__('ServicePing|Servic
e ping is off')"
:svg-path=
"svgPath"
>
<template
#description
>
<template
#description
>
<gl-sprintf
<gl-sprintf
v-if=
"!isAdmin"
v-if=
"!isAdmin"
:message=
"
:message=
"
__(
s
__(
'
To view instance-level analytics, ask an admin to turn on %
{docLinkStart}usag
e ping%{docLinkEnd}.',
'
ServicePing|To view instance-level analytics, ask an admin to turn on %
{docLinkStart}servic
e ping%{docLinkEnd}.',
)
)
"
"
>
>
<template
#docLink
="
{ content }">
<template
#docLink
="
{ content }">
<gl-link
:href=
"docsLink"
target=
"_blank"
>
{{
content
}}
</gl-link>
<gl-link
:href=
"docsLink"
target=
"_blank"
data-testid=
"docs-link"
>
{{
content
}}
</gl-link>
</
template
>
</
template
>
</gl-sprintf>
</gl-sprintf>
<
template
v-else
<
template
v-else
>
>
<p>
<p>
{{
__
(
'
Turn on usag
e ping to review instance-level analytics.
'
)
}}
{{
s__
(
'
ServicePing|Turn on servic
e ping to review instance-level analytics.
'
)
}}
</p>
</p>
<gl-button
category=
"primary"
variant=
"success"
:href=
"primaryButtonPath"
>
<gl-button
{{
__
(
'
Turn on usage ping
'
)
}}
</gl-button
category=
"primary"
variant=
"success"
:href=
"primaryButtonPath"
data-testid=
"power-on-button"
>
>
{{
s__
(
'
ServicePing|Turn on service ping
'
)
}}
</gl-button>
</
template
>
</
template
>
</template>
</template>
</gl-empty-state>
</gl-empty-state>
...
...
app/assets/javascripts/analytics/devops_report/devops_score_disabled_
usag
e_ping.js
→
app/assets/javascripts/analytics/devops_report/devops_score_disabled_
servic
e_ping.js
View file @
64ae70c1
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
UserCallout
from
'
~/user_callout
'
;
import
UserCallout
from
'
~/user_callout
'
;
import
UsagePingDisabled
from
'
./components/usag
e_ping_disabled.vue
'
;
import
ServicePingDisabled
from
'
./components/servic
e_ping_disabled.vue
'
;
export
default
()
=>
{
export
default
()
=>
{
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
UserCallout
();
new
UserCallout
();
const
emptyStateContainer
=
document
.
getElementById
(
'
js-devops-
usag
e-ping-disabled
'
);
const
emptyStateContainer
=
document
.
getElementById
(
'
js-devops-
servic
e-ping-disabled
'
);
if
(
!
emptyStateContainer
)
return
false
;
if
(
!
emptyStateContainer
)
return
false
;
const
{
emptyStateSvgPath
,
enableUsagePingLink
,
docsLink
,
isAdmin
}
=
emptyStateContainer
.
dataset
;
const
{
isAdmin
,
emptyStateSvgPath
,
enableServicePingPath
,
docsLink
,
}
=
emptyStateContainer
.
dataset
;
return
new
Vue
({
return
new
Vue
({
el
:
emptyStateContainer
,
el
:
emptyStateContainer
,
provide
:
{
provide
:
{
isAdmin
:
Boolean
(
isAdmin
),
isAdmin
:
parse
Boolean
(
isAdmin
),
svgPath
:
emptyStateSvgPath
,
svgPath
:
emptyStateSvgPath
,
primaryButtonPath
:
enable
UsagePingLink
,
primaryButtonPath
:
enable
ServicePingPath
,
docsLink
,
docsLink
,
},
},
render
(
h
)
{
render
(
h
)
{
return
h
(
Usag
ePingDisabled
);
return
h
(
Servic
ePingDisabled
);
},
},
});
});
};
};
app/assets/javascripts/pages/admin/dev_ops_report/index.js
View file @
64ae70c1
import
initDevOpsScore
from
'
~/analytics/devops_report/devops_score
'
;
import
initDevOpsScore
from
'
~/analytics/devops_report/devops_score
'
;
import
initDevOpsScoreDisabled
UsagePing
from
'
~/analytics/devops_report/devops_score_disabled_usag
e_ping
'
;
import
initDevOpsScoreDisabled
ServicePing
from
'
~/analytics/devops_report/devops_score_disabled_servic
e_ping
'
;
initDevOpsScoreDisabled
Usag
ePing
();
initDevOpsScoreDisabled
Servic
ePing
();
initDevOpsScore
();
initDevOpsScore
();
app/views/admin/dev_ops_report/_report.html.haml
View file @
64ae70c1
-
usag
e_ping_enabled
=
Gitlab
::
CurrentSettings
.
usage_ping_enabled
-
servic
e_ping_enabled
=
Gitlab
::
CurrentSettings
.
usage_ping_enabled
-
if
usag
e_ping_enabled
&&
show_callout?
(
'dev_ops_report_intro_callout_dismissed'
)
-
if
servic
e_ping_enabled
&&
show_callout?
(
'dev_ops_report_intro_callout_dismissed'
)
=
render
'callout'
=
render
'callout'
-
if
!
usag
e_ping_enabled
-
if
!
servic
e_ping_enabled
#js-devops-
usage-ping-disabled
{
data:
{
is_admin:
current_user
&
.
admin
.
to_s
,
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
(
'development/usage_ping/index.md'
)
}
}
#js-devops-
service-ping-disabled
{
data:
{
is_admin:
current_user
&
.
admin
.
to_s
,
empty_state_svg_path:
image_path
(
'illustrations/convdev/convdev_no_index.svg'
),
enable_service_ping_path
:
metrics_and_profiling_admin_application_settings_path
(
anchor:
'js-usage-settings'
),
docs_link:
help_page_path
(
'development/usage_ping/index.md'
)
}
}
-
else
-
else
#js-devops-score
{
data:
{
devops_score_metrics:
devops_score_metrics
(
@metric
).
to_json
,
devops_report_docs_path:
help_page_path
(
'user/admin_area/analytics/dev_ops_report'
),
no_data_image_path:
image_path
(
'dev_ops_report_no_data.svg'
)
}
}
#js-devops-score
{
data:
{
devops_score_metrics:
devops_score_metrics
(
@metric
).
to_json
,
devops_report_docs_path:
help_page_path
(
'user/admin_area/analytics/dev_ops_report'
),
no_data_image_path:
image_path
(
'dev_ops_report_no_data.svg'
)
}
}
ee/app/views/admin/dev_ops_report/_devops_tabs.html.haml
View file @
64ae70c1
-
usag
e_ping_enabled
=
Gitlab
::
CurrentSettings
.
usage_ping_enabled
-
servic
e_ping_enabled
=
Gitlab
::
CurrentSettings
.
usage_ping_enabled
%h2
%h2
=
_
(
'DevOps Report'
)
=
_
(
'DevOps Report'
)
-
if
usag
e_ping_enabled
&&
show_callout?
(
'dev_ops_report_intro_callout_dismissed'
)
-
if
servic
e_ping_enabled
&&
show_callout?
(
'dev_ops_report_intro_callout_dismissed'
)
=
render_ce
'admin/dev_ops_report/callout'
=
render_ce
'admin/dev_ops_report/callout'
-
if
!
usag
e_ping_enabled
-
if
!
servic
e_ping_enabled
#js-devops-
usage-ping-disabled
{
data:
{
is_admin:
current_user
&
.
admin
.
to_s
,
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
(
'development/usage_ping/index.md'
)
}
}
#js-devops-
service-ping-disabled
{
data:
{
is_admin:
current_user
&
.
admin
.
to_s
,
empty_state_svg_path:
image_path
(
'illustrations/convdev/convdev_no_index.svg'
),
enable_service_ping_path
:
metrics_and_profiling_admin_application_settings_path
(
anchor:
'js-usage-settings'
),
docs_link:
help_page_path
(
'development/usage_ping/index.md'
)
}
}
-
else
-
else
.js-devops-adoption
{
data:
{
empty_state_svg_path:
image_path
(
'illustrations/monitoring/getting_started.svg'
),
devops_score_metrics:
devops_score_metrics
(
@metric
).
to_json
,
devops_report_docs_path:
help_page_path
(
'user/admin_area/analytics/dev_ops_report'
),
no_data_image_path:
image_path
(
'dev_ops_report_no_data.svg'
)
}
}
.js-devops-adoption
{
data:
{
empty_state_svg_path:
image_path
(
'illustrations/monitoring/getting_started.svg'
),
devops_score_metrics:
devops_score_metrics
(
@metric
).
to_json
,
devops_report_docs_path:
help_page_path
(
'user/admin_area/analytics/dev_ops_report'
),
no_data_image_path:
image_path
(
'dev_ops_report_no_data.svg'
)
}
}
ee/spec/features/admin/admin_dev_ops_report_spec.rb
View file @
64ae70c1
...
@@ -134,7 +134,7 @@ RSpec.describe 'DevOps Report page', :js do
...
@@ -134,7 +134,7 @@ RSpec.describe 'DevOps Report page', :js do
it
'shows empty state'
do
it
'shows empty state'
do
visit
admin_dev_ops_report_path
(
tab:
'devops-score'
)
visit
admin_dev_ops_report_path
(
tab:
'devops-score'
)
expect
(
page
).
to
have_
selector
(
".js-empty-state"
)
expect
(
page
).
to
have_
text
(
'Service ping is off'
)
end
end
it
'hides the intro callout'
do
it
'hides the intro callout'
do
...
...
locale/gitlab.pot
View file @
64ae70c1
...
@@ -29819,6 +29819,18 @@ msgstr ""
...
@@ -29819,6 +29819,18 @@ msgstr ""
msgid "ServiceDesk|Your users can send emails to this address:"
msgid "ServiceDesk|Your users can send emails to this address:"
msgstr ""
msgstr ""
msgid "ServicePing|Service ping is off"
msgstr ""
msgid "ServicePing|To view instance-level analytics, ask an admin to turn on %{docLinkStart}service ping%{docLinkEnd}."
msgstr ""
msgid "ServicePing|Turn on service ping"
msgstr ""
msgid "ServicePing|Turn on service ping to review instance-level analytics."
msgstr ""
msgid "Session ID"
msgid "Session ID"
msgstr ""
msgstr ""
...
@@ -34387,9 +34399,6 @@ msgstr ""
...
@@ -34387,9 +34399,6 @@ msgstr ""
msgid "To view all %{scannedResourcesCount} scanned URLs, %{linkStart}please download the CSV file%{linkEnd}"
msgid "To view all %{scannedResourcesCount} scanned URLs, %{linkStart}please download the CSV file%{linkEnd}"
msgstr ""
msgstr ""
msgid "To view instance-level analytics, ask an admin to turn on %{docLinkStart}usage ping%{docLinkEnd}."
msgstr ""
msgid "To widen your search, change or remove filters above"
msgid "To widen your search, change or remove filters above"
msgstr ""
msgstr ""
...
@@ -34791,12 +34800,6 @@ msgstr ""
...
@@ -34791,12 +34800,6 @@ msgstr ""
msgid "Turn on"
msgid "Turn on"
msgstr ""
msgstr ""
msgid "Turn on usage ping"
msgstr ""
msgid "Turn on usage ping to review instance-level analytics."
msgstr ""
msgid "Twitter"
msgid "Twitter"
msgstr ""
msgstr ""
...
@@ -35358,9 +35361,6 @@ msgstr ""
...
@@ -35358,9 +35361,6 @@ msgstr ""
msgid "Usage Trends"
msgid "Usage Trends"
msgstr ""
msgstr ""
msgid "Usage ping is off"
msgstr ""
msgid "Usage statistics"
msgid "Usage statistics"
msgstr ""
msgstr ""
...
...
spec/features/admin/admin_dev_ops_report_spec.rb
View file @
64ae70c1
...
@@ -32,7 +32,7 @@ RSpec.describe 'DevOps Report page', :js do
...
@@ -32,7 +32,7 @@ RSpec.describe 'DevOps Report page', :js do
it
'shows empty state'
do
it
'shows empty state'
do
visit
admin_dev_ops_report_path
visit
admin_dev_ops_report_path
expect
(
page
).
to
have_
selector
(
".js-empty-state"
)
expect
(
page
).
to
have_
text
(
'Service ping is off'
)
end
end
it
'hides the intro callout'
do
it
'hides the intro callout'
do
...
...
spec/frontend/analytics/devops_report/components/service_ping_disabled_spec.js
0 → 100644
View file @
64ae70c1
import
{
GlEmptyState
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
ServicePingDisabled
from
'
~/analytics/devops_report/components/service_ping_disabled.vue
'
;
describe
(
'
~/analytics/devops_report/components/service_ping_disabled.vue
'
,
()
=>
{
let
wrapper
;
afterEach
(()
=>
{
wrapper
.
destroy
();
});
const
createWrapper
=
({
isAdmin
=
false
}
=
{})
=>
{
wrapper
=
shallowMountExtended
(
ServicePingDisabled
,
{
provide
:
{
isAdmin
,
svgPath
:
TEST_HOST
,
docsLink
:
TEST_HOST
,
primaryButtonPath
:
TEST_HOST
,
},
stubs
:
{
GlEmptyState
,
GlSprintf
},
});
};
const
findEmptyState
=
()
=>
wrapper
.
findComponent
(
GlEmptyState
);
const
findMessageForRegularUsers
=
()
=>
wrapper
.
findComponent
(
GlSprintf
);
const
findDocsLink
=
()
=>
wrapper
.
findByTestId
(
'
docs-link
'
);
const
findPowerOnButton
=
()
=>
wrapper
.
findByTestId
(
'
power-on-button
'
);
it
(
'
renders empty state with provided SVG path
'
,
()
=>
{
createWrapper
();
expect
(
findEmptyState
().
props
(
'
svgPath
'
)).
toBe
(
TEST_HOST
);
});
describe
(
'
for regular users
'
,
()
=>
{
beforeEach
(()
=>
{
createWrapper
({
isAdmin
:
false
});
});
it
(
'
renders message without power-on button
'
,
()
=>
{
expect
(
findMessageForRegularUsers
().
exists
()).
toBe
(
true
);
expect
(
findPowerOnButton
().
exists
()).
toBe
(
false
);
});
it
(
'
renders docs link
'
,
()
=>
{
expect
(
findDocsLink
().
exists
()).
toBe
(
true
);
expect
(
findDocsLink
().
attributes
(
'
href
'
)).
toBe
(
TEST_HOST
);
});
});
describe
(
'
for admins
'
,
()
=>
{
beforeEach
(()
=>
{
createWrapper
({
isAdmin
:
true
});
});
it
(
'
renders power-on button
'
,
()
=>
{
expect
(
findPowerOnButton
().
exists
()).
toBe
(
true
);
});
});
});
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