Commit 4a609846 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch '232989-update-compliance-dashboard-empty-copy' into 'master'

Improve compliance dashboard empty state copy

See merge request gitlab-org/gitlab!45273
parents abc863a5 f0d50b68
<script> <script>
import { GlLink, GlEmptyState } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
export default { export default {
components: {
GlLink,
GlEmptyState,
},
props: { props: {
imagePath: { imagePath: {
type: String, type: String,
...@@ -9,27 +14,24 @@ export default { ...@@ -9,27 +14,24 @@ export default {
}, },
}, },
strings: { strings: {
heading: __( heading: __("A merge request hasn't yet been merged"),
"Merge requests are a place to propose changes you've made to a project and discuss those changes with others", subheading: __(
"The Compliance Dashboard gives you the ability to see a group's merge request activity by providing a high-level view for all projects in the group.",
), ),
subheading: __('Interested parties can even contribute by pushing commits if they want to.'), documentation: __('View documentation'),
alt: __('Merge Requests'),
}, },
documentationPath: 'https://docs.gitlab.com/ee/user/compliance/compliance_dashboard/index.html',
}; };
</script> </script>
<template> <template>
<div class="row empty-state merge-requests"> <gl-empty-state
<div class="col-12"> :title="$options.strings.heading"
<div class="svg-content"> :description="$options.strings.subheading"
<img :src="imagePath" :alt="$options.strings.alt" /> :svg-path="imagePath"
</div> >
</div> <template #actions>
<div class="col-12"> <gl-link :href="$options.documentationPath">{{ $options.strings.documentation }}</gl-link>
<div class="text-content"> </template>
<h4>{{ $options.strings.heading }}</h4> </gl-empty-state>
<p>{{ $options.strings.subheading }}</p>
</div>
</div>
</div>
</template> </template>
---
title: Improve compliance dashboard empty state message
merge_request: 45273
author:
type: changed
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlEmptyState } from '@gitlab/ui';
import EmptyState from 'ee/compliance_dashboard/components/empty_state.vue'; import EmptyState from 'ee/compliance_dashboard/components/empty_state.vue';
...@@ -7,8 +8,7 @@ const IMAGE_PATH = 'empty.svg'; ...@@ -7,8 +8,7 @@ const IMAGE_PATH = 'empty.svg';
describe('EmptyState component', () => { describe('EmptyState component', () => {
let wrapper; let wrapper;
const findImage = () => wrapper.find('img'); const emptyStateProp = prop => wrapper.find(GlEmptyState).props(prop);
const findText = () => wrapper.find('.text-content');
const createComponent = (props = {}) => { const createComponent = (props = {}) => {
return shallowMount(EmptyState, { return shallowMount(EmptyState, {
...@@ -29,12 +29,12 @@ describe('EmptyState component', () => { ...@@ -29,12 +29,12 @@ describe('EmptyState component', () => {
describe('behaviour', () => { describe('behaviour', () => {
it('sets the empty SVG path', () => { it('sets the empty SVG path', () => {
expect(findImage().element.getAttribute('src')).toEqual(IMAGE_PATH); expect(emptyStateProp('svgPath')).toBe(IMAGE_PATH);
}); });
it('renders a message', () => { it('sets the description', () => {
expect(findText().text()).toEqual( expect(emptyStateProp('description')).toBe(
"Merge requests are a place to propose changes you've made to a project and discuss those changes with others Interested parties can even contribute by pushing commits if they want to.", "The Compliance Dashboard gives you the ability to see a group's merge request activity by providing a high-level view for all projects in the group.",
); );
}); });
}); });
......
...@@ -1253,6 +1253,9 @@ msgstr "" ...@@ -1253,6 +1253,9 @@ msgstr ""
msgid "A merge request approval is required when the license compliance report contains a denied license." msgid "A merge request approval is required when the license compliance report contains a denied license."
msgstr "" msgstr ""
msgid "A merge request hasn't yet been merged"
msgstr ""
msgid "A new Auto DevOps pipeline has been created, go to %{pipelines_link_start}Pipelines page%{pipelines_link_end} for details" msgid "A new Auto DevOps pipeline has been created, go to %{pipelines_link_start}Pipelines page%{pipelines_link_end} for details"
msgstr "" msgstr ""
...@@ -27121,6 +27124,9 @@ msgstr "" ...@@ -27121,6 +27124,9 @@ msgstr ""
msgid "The CSV export will be created in the background. Once finished, it will be sent to %{strong_open}%{email}%{strong_close} in an attachment." msgid "The CSV export will be created in the background. Once finished, it will be sent to %{strong_open}%{email}%{strong_close} in an attachment."
msgstr "" msgstr ""
msgid "The Compliance Dashboard gives you the ability to see a group's merge request activity by providing a high-level view for all projects in the group."
msgstr ""
msgid "The GitLab user to which the Jira user %{jiraDisplayName} will be mapped" msgid "The GitLab user to which the Jira user %{jiraDisplayName} will be mapped"
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