Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 21:42:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 21:42:06 +0300
commit6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch)
tree78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/analytics
parent1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff)
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/assets/javascripts/analytics')
-rw-r--r--app/assets/javascripts/analytics/cycle_analytics/mixins/filter_mixins.js1
-rw-r--r--app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js28
-rw-r--r--app/assets/javascripts/analytics/product_analytics/components/activity_chart.vue42
3 files changed, 70 insertions, 1 deletions
diff --git a/app/assets/javascripts/analytics/cycle_analytics/mixins/filter_mixins.js b/app/assets/javascripts/analytics/cycle_analytics/mixins/filter_mixins.js
deleted file mode 100644
index ff8b4c56321..00000000000
--- a/app/assets/javascripts/analytics/cycle_analytics/mixins/filter_mixins.js
+++ /dev/null
@@ -1 +0,0 @@
-export default {};
diff --git a/app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js b/app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js
new file mode 100644
index 00000000000..d1f4b537b11
--- /dev/null
+++ b/app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js
@@ -0,0 +1,28 @@
+import Vue from 'vue';
+import ActivityChart from './components/activity_chart.vue';
+
+export default () => {
+ const containers = document.querySelectorAll('.js-project-analytics-chart');
+
+ if (!containers) {
+ return false;
+ }
+
+ return containers.forEach(container => {
+ const { chartData } = container.dataset;
+ const formattedData = JSON.parse(chartData);
+
+ return new Vue({
+ el: container,
+ provide: {
+ formattedData,
+ },
+ components: {
+ ActivityChart,
+ },
+ render(createElement) {
+ return createElement('activity-chart');
+ },
+ });
+ });
+};
diff --git a/app/assets/javascripts/analytics/product_analytics/components/activity_chart.vue b/app/assets/javascripts/analytics/product_analytics/components/activity_chart.vue
new file mode 100644
index 00000000000..a475ff8fd25
--- /dev/null
+++ b/app/assets/javascripts/analytics/product_analytics/components/activity_chart.vue
@@ -0,0 +1,42 @@
+<script>
+import { GlColumnChart } from '@gitlab/ui/dist/charts';
+import { s__ } from '~/locale';
+
+export default {
+ i18n: {
+ noDataMsg: s__(
+ 'ProductAnalytics|There is no data for this type of chart currently. Please see the Setup tab if you have not configured the product analytics tool already.',
+ ),
+ },
+ components: {
+ GlColumnChart,
+ },
+ inject: {
+ formattedData: {
+ default: {},
+ },
+ },
+ computed: {
+ seriesData() {
+ return {
+ full: this.formattedData.keys.map((val, idx) => [val, this.formattedData.values[idx]]),
+ };
+ },
+ },
+};
+</script>
+
+<template>
+ <div class="gl-xs-w-full">
+ <gl-column-chart
+ v-if="formattedData.keys"
+ :data="seriesData"
+ :x-axis-title="__('Value')"
+ :y-axis-title="__('Number of events')"
+ :x-axis-type="'category'"
+ />
+ <p v-else data-testid="noActivityChartData">
+ {{ $options.i18n.noDataMsg }}
+ </p>
+ </div>
+</template>