Skip to content
Snippets Groups Projects

Update analytics dashboard list to match MVC design

Merged Jiaan Louw requested to merge 381322-product-analytics-dashboards-list into master
All threads resolved!
Files
3
<script>
import { GlAvatar, GlIcon, GlLabel, GlLink } from '@gitlab/ui';
import { s__, __ } from '~/locale';
import { helpPagePath } from '~/helpers/help_page_helper';
import jsonList from '../gl_dashboards/analytics_dashboards.json';
import { I18N_DASHBOARD_LIST } from '../constants';
export default {
name: 'AnalyticsDashboard',
@@ -17,34 +17,24 @@ export default {
dashboards: jsonList.internalDashboards,
};
},
computed: {
helpPageUrl() {
return helpPagePath('user/product_analytics/index', {
anchor: 'product-analytics-dashboards',
});
},
},
methods: {
onRowClick(dashboarId) {
return this.$router.push(dashboarId);
routeToDashboard(dashboardId) {
return this.$router.push(dashboardId);
},
},
i18n: {
title: s__('ProductAnalytics|Product analytics dashboards'),
description: s__(
'ProductAnalytics|Dashboards are created by editing the projects dashboard files.',
),
learnMore: __('Learn more.'),
},
i18n: I18N_DASHBOARD_LIST,
helpPageUrl: helpPagePath('user/product_analytics/index', {
anchor: 'product-analytics-dashboards',
}),
};
</script>
<template>
<div>
<h2>{{ $options.i18n.title }}</h2>
<p>
<h2 data-testid="title">{{ $options.i18n.title }}</h2>
<p data-testid="description">
{{ $options.i18n.description }}
<gl-link data-testid="help-link" :href="helpPageUrl" target="_blank">{{
<gl-link data-testid="help-link" :href="$options.helpPageUrl">{{
$options.i18n.learnMore
}}</gl-link>
</p>
@@ -54,7 +44,7 @@ export default {
:key="dashboard.id"
data-testid="dashboard-list-item"
class="gl-display-flex! gl-px-5! gl-align-items-center gl-hover-cursor-pointer gl-hover-bg-blue-50"
@click="onRowClick(dashboard.id)"
@click="routeToDashboard(dashboard.id)"
>
<div class="gl-float-left gl-mr-4 gl-display-flex gl-align-items-center">
<gl-icon
Loading