diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/assets/javascripts/admin | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/assets/javascripts/admin')
4 files changed, 104 insertions, 5 deletions
diff --git a/app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js b/app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js index b4803be4d52..f89533aeb1d 100644 --- a/app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js +++ b/app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js @@ -1,8 +1,7 @@ import PayloadPreviewer from '~/pages/admin/application_settings/payload_previewer'; export default () => { - new PayloadPreviewer( - document.querySelector('.js-usage-ping-payload-trigger'), - document.querySelector('.js-usage-ping-payload'), - ).init(); + Array.from(document.querySelectorAll('.js-payload-preview-trigger')).forEach(trigger => { + new PayloadPreviewer(trigger).init(); + }); }; diff --git a/app/assets/javascripts/admin/cohorts/components/usage_ping_disabled.vue b/app/assets/javascripts/admin/cohorts/components/usage_ping_disabled.vue new file mode 100644 index 00000000000..2ea55d44420 --- /dev/null +++ b/app/assets/javascripts/admin/cohorts/components/usage_ping_disabled.vue @@ -0,0 +1,48 @@ +<script> +import { GlEmptyState, GlSprintf, GlLink } from '@gitlab/ui'; + +export default { + components: { + GlEmptyState, + GlSprintf, + GlLink, + }, + inject: { + svgPath: { + type: String, + }, + docsLink: { + type: String, + }, + primaryButtonPath: { + type: String, + }, + }, +}; +</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> diff --git a/app/assets/javascripts/admin/dev_ops_report/components/usage_ping_disabled.vue b/app/assets/javascripts/admin/dev_ops_report/components/usage_ping_disabled.vue new file mode 100644 index 00000000000..5429ec403d3 --- /dev/null +++ b/app/assets/javascripts/admin/dev_ops_report/components/usage_ping_disabled.vue @@ -0,0 +1,53 @@ +<script> +import { GlEmptyState, GlSprintf, GlLink, GlButton } from '@gitlab/ui'; + +export default { + components: { + GlEmptyState, + GlSprintf, + GlLink, + GlButton, + }, + inject: { + isAdmin: { + type: Boolean, + }, + svgPath: { + type: String, + }, + docsLink: { + type: String, + }, + primaryButtonPath: { + type: String, + }, + }, +}; +</script> +<template> + <gl-empty-state class="js-empty-state" :title="__('Usage ping is off')" :svg-path="svgPath"> + <template #description> + <gl-sprintf + v-if="!isAdmin" + :message=" + __( + 'To view instance-level analytics, ask an admin to turn on %{docLinkStart}usage ping%{docLinkEnd}.', + ) + " + > + <template #docLink="{content}"> + <gl-link :href="docsLink" target="_blank">{{ content }}</gl-link> + </template> + </gl-sprintf> + <template v-else + ><p> + {{ __('Turn on usage ping to review instance-level analytics.') }} + </p> + + <gl-button category="primary" variant="success" :href="primaryButtonPath"> + {{ __('Turn on usage ping') }}</gl-button + > + </template> + </template> + </gl-empty-state> +</template> diff --git a/app/assets/javascripts/admin/statistics_panel/store/getters.js b/app/assets/javascripts/admin/statistics_panel/store/getters.js index 2aa34b8f38e..1c1868b5bca 100644 --- a/app/assets/javascripts/admin/statistics_panel/store/getters.js +++ b/app/assets/javascripts/admin/statistics_panel/store/getters.js @@ -3,7 +3,6 @@ * and returns an array of the following form: * [{ key: "forks", label: "Forks", value: 50 }] */ -// eslint-disable-next-line import/prefer-default-export export const getStatistics = state => labels => Object.keys(labels).map(key => { const result = { |