Commit 14d7082c authored by Nathan Friend's avatar Nathan Friend

Merge branch '24324-remove-button-row-from-environments-empty-state' into 'master'

Resolve "Remove button row from environments empty state"

Closes #24324

See merge request gitlab-org/gitlab!35413
parents c9b77118 0514d00f
......@@ -2,14 +2,6 @@
export default {
name: 'EnvironmentsEmptyState',
props: {
newPath: {
type: String,
required: true,
},
canCreateEnvironment: {
type: Boolean,
required: true,
},
helpPath: {
type: String,
required: true,
......@@ -28,18 +20,8 @@ export default {
s__(`Environments|Environments are places where
code gets deployed, such as staging or production.`)
}}
<a :href="helpPath"> {{ s__('Environments|Read more about environments') }} </a>
<a :href="helpPath"> {{ s__('Environments|More information') }} </a>
</p>
<div class="text-center">
<a
v-if="canCreateEnvironment"
:href="newPath"
class="btn btn-success js-new-environment-button"
>
{{ s__('Environments|New environment') }}
</a>
</div>
</div>
</div>
</template>
......@@ -159,11 +159,7 @@ export default {
@onChangePage="onChangePage"
>
<template v-if="!isLoading && state.environments.length === 0" #emptyState>
<empty-state
:new-path="newEnvironmentPath"
:help-path="helpPagePath"
:can-create-environment="canCreateEnvironment"
/>
<empty-state :help-path="helpPagePath" />
</template>
</container>
</div>
......
......@@ -3,7 +3,7 @@
%h4.gl-mt-0
= _("Environments")
%p
- link_to_read_more = link_to(_("Read more about environments"), help_page_path("ci/environments/index.md"))
- link_to_read_more = link_to(_("More information"), help_page_path("ci/environments/index.md"))
= _("Environments allow you to track deployments of your application %{link_to_read_more}.").html_safe % { link_to_read_more: link_to_read_more }
= form_for [@project.namespace.becomes(Namespace), @project, @environment], html: { class: 'col-lg-9' } do |f|
......
---
title: Resolve Remove button row from environments empty state
merge_request: 35413
author:
type: changed
......@@ -8857,6 +8857,9 @@ msgstr ""
msgid "Environments|Logs from %{start} to %{end}."
msgstr ""
msgid "Environments|More information"
msgstr ""
msgid "Environments|New environment"
msgstr ""
......@@ -8896,9 +8899,6 @@ msgstr ""
msgid "Environments|Re-deploy to environment"
msgstr ""
msgid "Environments|Read more about environments"
msgstr ""
msgid "Environments|Rollback"
msgstr ""
......@@ -18696,9 +18696,6 @@ msgstr ""
msgid "Read more"
msgstr ""
msgid "Read more about environments"
msgstr ""
msgid "Read more about project permissions <strong>%{link_to_help}</strong>"
msgstr ""
......
......@@ -7,8 +7,6 @@ describe('environments empty state', () => {
beforeEach(() => {
vm = shallowMount(EmptyState, {
propsData: {
newPath: 'foo',
canCreateEnvironment: true,
helpPath: 'bar',
},
});
......@@ -23,18 +21,4 @@ describe('environments empty state', () => {
"You don't have any environments right now",
);
});
it('renders the new environment button', () => {
expect(vm.find('.js-new-environment-button').attributes('href')).toEqual('foo');
});
describe('without permission', () => {
beforeEach(() => {
vm.setProps({ canCreateEnvironment: false });
});
it('does not render the new environment button', () => {
expect(vm.find('.js-new-environment-button').exists()).toBe(false);
});
});
});
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