Commit 994d1ad6 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'nfriend-add-group-level-deployment-frequency-graph' into 'master'

Add group-level deployment frequency charts

See merge request gitlab-org/gitlab!61053
parents 5b38c607 8c25e9b0
<script> <script>
import { GlTabs, GlTab } from '@gitlab/ui'; import { GlTabs, GlTab } from '@gitlab/ui';
import DeploymentFrequencyCharts from 'ee/dora/components/deployment_frequency_charts.vue';
import { mergeUrlParams, updateHistory, getParameterValues } from '~/lib/utils/url_utility'; import { mergeUrlParams, updateHistory, getParameterValues } from '~/lib/utils/url_utility';
import { TABS } from '../constants'; import { TABS } from '../constants';
import ReleaseStatsCard from './release_stats_card.vue'; import ReleaseStatsCard from './release_stats_card.vue';
...@@ -10,6 +11,7 @@ export default { ...@@ -10,6 +11,7 @@ export default {
ReleaseStatsCard, ReleaseStatsCard,
GlTabs, GlTabs,
GlTab, GlTab,
DeploymentFrequencyCharts,
}, },
data() { data() {
return { return {
...@@ -42,6 +44,9 @@ export default { ...@@ -42,6 +44,9 @@ export default {
<gl-tab :title="s__('CICDAnalytics|Release statistics')"> <gl-tab :title="s__('CICDAnalytics|Release statistics')">
<release-stats-card class="gl-mt-5" /> <release-stats-card class="gl-mt-5" />
</gl-tab> </gl-tab>
<gl-tab :title="s__('CICDAnalytics|Deployment frequency')">
<deployment-frequency-charts />
</gl-tab>
</gl-tabs> </gl-tabs>
</div> </div>
</template> </template>
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
GlSkeletonLoader, GlSkeletonLoader,
}, },
inject: { inject: {
fullPath: { groupPath: {
default: '', default: '',
}, },
}, },
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
query: groupReleaseStatsQuery, query: groupReleaseStatsQuery,
variables() { variables() {
return { return {
fullPath: this.fullPath, fullPath: this.groupPath,
}; };
}, },
update(data) { update(data) {
......
export const STAT_ERROR_PLACEHOLDER = '-'; export const STAT_ERROR_PLACEHOLDER = '-';
export const TABS = ['release-statistics']; export const TABS = ['release-statistics', 'deployment-frequency'];
...@@ -20,7 +20,7 @@ export default () => { ...@@ -20,7 +20,7 @@ export default () => {
el, el,
apolloProvider, apolloProvider,
provide: { provide: {
fullPath, groupPath: fullPath,
}, },
render: (createElement) => createElement(CiCdAnalyticsApp), render: (createElement) => createElement(CiCdAnalyticsApp),
}); });
......
---
title: Add group-level deployment frequency charts
merge_request: 61053
author:
type: added
...@@ -2,6 +2,7 @@ import { GlTabs, GlTab } from '@gitlab/ui'; ...@@ -2,6 +2,7 @@ import { GlTabs, GlTab } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import CiCdAnalyticsApp from 'ee/analytics/group_ci_cd_analytics/components/app.vue'; import CiCdAnalyticsApp from 'ee/analytics/group_ci_cd_analytics/components/app.vue';
import ReleaseStatsCard from 'ee/analytics/group_ci_cd_analytics/components/release_stats_card.vue'; import ReleaseStatsCard from 'ee/analytics/group_ci_cd_analytics/components/release_stats_card.vue';
import DeploymentFrequencyCharts from 'ee/dora/components/deployment_frequency_charts.vue';
import setWindowLocation from 'helpers/set_window_location_helper'; import setWindowLocation from 'helpers/set_window_location_helper';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import { getParameterValues } from '~/lib/utils/url_utility'; import { getParameterValues } from '~/lib/utils/url_utility';
...@@ -32,6 +33,7 @@ describe('ee/analytics/group_ci_cd_analytics/components/app.vue', () => { ...@@ -32,6 +33,7 @@ describe('ee/analytics/group_ci_cd_analytics/components/app.vue', () => {
expect(findGlTabs().exists()).toBe(true); expect(findGlTabs().exists()).toBe(true);
expect(findGlTabAtIndex(0).attributes('title')).toBe('Release statistics'); expect(findGlTabAtIndex(0).attributes('title')).toBe('Release statistics');
expect(findGlTabAtIndex(1).attributes('title')).toBe('Deployment frequency');
}); });
}); });
...@@ -41,7 +43,17 @@ describe('ee/analytics/group_ci_cd_analytics/components/app.vue', () => { ...@@ -41,7 +43,17 @@ describe('ee/analytics/group_ci_cd_analytics/components/app.vue', () => {
}); });
it('renders the release statistics component inside the first tab', () => { it('renders the release statistics component inside the first tab', () => {
expect(findGlTabAtIndex(0).find(ReleaseStatsCard).exists()).toBe(true); expect(findGlTabAtIndex(0).findComponent(ReleaseStatsCard).exists()).toBe(true);
});
});
describe('deployment frequency', () => {
beforeEach(() => {
createComponent();
});
it('renders the deployment frequency component inside the first tab', () => {
expect(findGlTabAtIndex(1).findComponent(DeploymentFrequencyCharts).exists()).toBe(true);
}); });
}); });
...@@ -49,6 +61,7 @@ describe('ee/analytics/group_ci_cd_analytics/components/app.vue', () => { ...@@ -49,6 +61,7 @@ describe('ee/analytics/group_ci_cd_analytics/components/app.vue', () => {
it.each` it.each`
tab | index tab | index
${'release-statistics'} | ${'0'} ${'release-statistics'} | ${'0'}
${'deployment-frequency'} | ${'1'}
${'fake'} | ${'0'} ${'fake'} | ${'0'}
${''} | ${'0'} ${''} | ${'0'}
`('shows the correct tab for URL parameter "$tab"', ({ tab, index }) => { `('shows the correct tab for URL parameter "$tab"', ({ tab, index }) => {
......
...@@ -5613,6 +5613,9 @@ msgstr "" ...@@ -5613,6 +5613,9 @@ msgstr ""
msgid "CICDAnalytics|All time" msgid "CICDAnalytics|All time"
msgstr "" msgstr ""
msgid "CICDAnalytics|Deployment frequency"
msgstr ""
msgid "CICDAnalytics|Projects with releases" msgid "CICDAnalytics|Projects with releases"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment