diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index dedff502a87999281182a6a6a2aeaddb33d433ae..13aedd6e4e095d5230e4c683589330c8fc75c303 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -38,7 +38,7 @@ = s_('GroupSettings|Badges') = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded ? _('Collapse') : _('Expand') - %p + %p.gl-text-secondary.gl-mb-0 = s_('GroupSettings|Customize this group\'s badges.') = link_to s_('GroupSettings|What are badges?'), help_page_path('user/project/badges') .settings-content diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index b9149bbd7b3d60615cbfec2beb07bd7598111678..78878141b800ed8d4e0c25dacdf27433e9403b20 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -46,7 +46,7 @@ = s_('ProjectSettings|Badges') = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded ? _('Collapse') : _('Expand') - %p + %p.gl-text-secondary.gl-mb-0 = s_('ProjectSettings|Customize this project\'s badges.') = link_to s_('ProjectSettings|What are badges?'), help_page_path('user/project/badges') .settings-content diff --git a/ee/app/assets/javascripts/groups/settings/compliance_frameworks/components/table.vue b/ee/app/assets/javascripts/groups/settings/compliance_frameworks/components/table.vue index f16040552d9aa9a7799c3145f77af660b2a30f86..b3f09d26a3371da789aca83a2bbd0f7aaaa9d79e 100644 --- a/ee/app/assets/javascripts/groups/settings/compliance_frameworks/components/table.vue +++ b/ee/app/assets/javascripts/groups/settings/compliance_frameworks/components/table.vue @@ -1,12 +1,21 @@ - + -import { GlButton, GlEmptyState } from '@gitlab/ui'; +import { GlEmptyState } from '@gitlab/ui'; import { s__ } from '~/locale'; export default { components: { - GlButton, GlEmptyState, }, props: { @@ -14,34 +13,22 @@ export default { default: null, }, }, - methods: { - onAddFramework(event) { - event.preventDefault(); - this.$emit('addFramework', event); - }, - }, i18n: { heading: s__('ComplianceFrameworks|No compliance frameworks are set up yet'), - description: s__('ComplianceFrameworks|Frameworks that have been added will appear here.'), - addButton: s__('ComplianceFrameworks|Add framework'), + description: s__( + 'ComplianceFrameworks|Frameworks that have been added will appear here, start by creating a new one above.', + ), }, }; - + - {{ $options.i18n.heading }} + {{ $options.i18n.heading }} - - {{ $options.i18n.addButton }} - + + {{ $options.i18n.description }} diff --git a/ee/app/views/groups/_compliance_frameworks.html.haml b/ee/app/views/groups/_compliance_frameworks.html.haml index 8c03fbc6596a040f42f8abd9251076ea938524a8..81a842b205e9e0313045e249d25cec526284ff28 100644 --- a/ee/app/views/groups/_compliance_frameworks.html.haml +++ b/ee/app/views/groups/_compliance_frameworks.html.haml @@ -8,7 +8,7 @@ = s_('GroupSettings|Compliance frameworks') = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded ? _('Collapse') : _('Expand') - %p + %p.gl-text-secondary.gl-mb-0 = html_escape(s_('GroupSettings|Configure compliance frameworks to make them available to projects in this group. %{linkStart}What are compliance frameworks?%{linkEnd}')) % { linkStart: compliance_framework_doc_link, linkEnd: ''.html_safe } .settings-content #js-compliance-frameworks-list{ data: compliance_frameworks_list_data(@group) } diff --git a/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_empty_state_spec.js b/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_empty_state_spec.js index 52bed5aa28cec5b673464c49f28ab30095e3e98b..5d7b000f08193a02d6f6c4b20a833fb6633565e7 100644 --- a/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_empty_state_spec.js +++ b/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_empty_state_spec.js @@ -1,4 +1,4 @@ -import { GlButton, GlEmptyState } from '@gitlab/ui'; +import { GlEmptyState } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import TableEmptyState from 'ee/groups/settings/compliance_frameworks/components/table_empty_state.vue'; @@ -7,7 +7,6 @@ describe('TableEmptyState', () => { let wrapper; const findEmptyState = () => wrapper.findComponent(GlEmptyState); - const findAddFrameworkButton = () => wrapper.findComponent(GlButton); const createComponent = () => { wrapper = shallowMount(TableEmptyState, { @@ -23,28 +22,18 @@ describe('TableEmptyState', () => { it('has the correct props', () => { expect(findEmptyState().props()).toMatchObject({ - description: 'Frameworks that have been added will appear here.', svgPath: 'dir/image.svg', svgHeight: 100, - compact: true, }); }); it('displays the correct title', () => { - expect(findEmptyState().find('h5').text()).toBe('No compliance frameworks are set up yet'); + expect(findEmptyState().find('h6').text()).toBe('No compliance frameworks are set up yet'); }); - it('has an add framework action', () => { - const button = findAddFrameworkButton(); - - expect(button.text()).toBe('Add framework'); - }); - - it('emits the expected event when the add framework button is clicked', () => { - const clickEvent = new Event('click'); - findAddFrameworkButton().vm.$emit('click', clickEvent); - - expect(wrapper.emitted('addFramework')).toHaveLength(1); - expect(wrapper.emitted('addFramework')[0][0]).toBe(clickEvent); + it('displays the correct description', () => { + expect(findEmptyState().find('p').text()).toBe( + 'Frameworks that have been added will appear here, start by creating a new one above.', + ); }); }); diff --git a/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_spec.js b/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_spec.js index 15ace2a637347975426ac8eb151c3329f2ab2f5b..24cdd95ac222b4f91db1cf3b2d4b9042ab51635f 100644 --- a/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_spec.js +++ b/ee/spec/frontend/groups/settings/compliance_frameworks/components/table_spec.js @@ -172,7 +172,7 @@ describe('Table', () => { describe('content', () => { beforeEach(async () => { - wrapper = createComponentWithApollo(fetch); + wrapper = createComponentWithApollo(fetch, shallowMount); await waitForPromises(); }); @@ -182,19 +182,23 @@ describe('Table', () => { expect(findEmptyState().exists()).toBe(false); }); - it('shows the add framework button', () => { - const addBtn = findAddBtn(); - - expect(addBtn.text()).toBe('Add framework'); - }); - it('renders the delete modal', () => { expect(findDeleteModal().exists()).toBe(true); }); + describe('when editing is available', () => { + beforeEach(() => { + wrapper = createComponentWithApollo(fetch, updateDefault, {}, mount); + }); + + it('shows the add framework button', () => { + expect(findAddBtn().text()).toBe('Add framework'); + }); + }); + describe('when editing is unavailable', () => { beforeEach(() => { - wrapper = createComponentWithApollo(fetch, updateDefault, {}, shallowMount, { + wrapper = createComponentWithApollo(fetch, updateDefault, {}, mount, { canAddEdit: false, }); }); diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 68f55630e6060fc71abd42d64a7797f6312e2f2e..fa271373a125e9e675ee204a837dfd27ddae79bd 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -11990,6 +11990,9 @@ msgstr "" msgid "Compliance framework" msgstr "" +msgid "ComplianceFrameworks|Active compliance frameworks" +msgstr "" + msgid "ComplianceFrameworks|Add framework" msgstr "" @@ -12047,7 +12050,7 @@ msgstr "" msgid "ComplianceFrameworks|Error setting the default compliance frameworks" msgstr "" -msgid "ComplianceFrameworks|Frameworks that have been added will appear here." +msgid "ComplianceFrameworks|Frameworks that have been added will appear here, start by creating a new one above." msgstr "" msgid "ComplianceFrameworks|Invalid format"
{{ $options.i18n.description }}