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 @@ ...@@ -2,14 +2,6 @@
export default { export default {
name: 'EnvironmentsEmptyState', name: 'EnvironmentsEmptyState',
props: { props: {
newPath: {
type: String,
required: true,
},
canCreateEnvironment: {
type: Boolean,
required: true,
},
helpPath: { helpPath: {
type: String, type: String,
required: true, required: true,
...@@ -28,18 +20,8 @@ export default { ...@@ -28,18 +20,8 @@ export default {
s__(`Environments|Environments are places where s__(`Environments|Environments are places where
code gets deployed, such as staging or production.`) 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> </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>
</div> </div>
</template> </template>
...@@ -159,11 +159,7 @@ export default { ...@@ -159,11 +159,7 @@ export default {
@onChangePage="onChangePage" @onChangePage="onChangePage"
> >
<template v-if="!isLoading && state.environments.length === 0" #emptyState> <template v-if="!isLoading && state.environments.length === 0" #emptyState>
<empty-state <empty-state :help-path="helpPagePath" />
:new-path="newEnvironmentPath"
:help-path="helpPagePath"
:can-create-environment="canCreateEnvironment"
/>
</template> </template>
</container> </container>
</div> </div>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
%h4.gl-mt-0 %h4.gl-mt-0
= _("Environments") = _("Environments")
%p %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 } = _("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| = 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 "" ...@@ -8857,6 +8857,9 @@ msgstr ""
msgid "Environments|Logs from %{start} to %{end}." msgid "Environments|Logs from %{start} to %{end}."
msgstr "" msgstr ""
msgid "Environments|More information"
msgstr ""
msgid "Environments|New environment" msgid "Environments|New environment"
msgstr "" msgstr ""
...@@ -8896,9 +8899,6 @@ msgstr "" ...@@ -8896,9 +8899,6 @@ msgstr ""
msgid "Environments|Re-deploy to environment" msgid "Environments|Re-deploy to environment"
msgstr "" msgstr ""
msgid "Environments|Read more about environments"
msgstr ""
msgid "Environments|Rollback" msgid "Environments|Rollback"
msgstr "" msgstr ""
...@@ -18696,9 +18696,6 @@ msgstr "" ...@@ -18696,9 +18696,6 @@ msgstr ""
msgid "Read more" msgid "Read more"
msgstr "" msgstr ""
msgid "Read more about environments"
msgstr ""
msgid "Read more about project permissions <strong>%{link_to_help}</strong>" msgid "Read more about project permissions <strong>%{link_to_help}</strong>"
msgstr "" msgstr ""
......
...@@ -7,8 +7,6 @@ describe('environments empty state', () => { ...@@ -7,8 +7,6 @@ describe('environments empty state', () => {
beforeEach(() => { beforeEach(() => {
vm = shallowMount(EmptyState, { vm = shallowMount(EmptyState, {
propsData: { propsData: {
newPath: 'foo',
canCreateEnvironment: true,
helpPath: 'bar', helpPath: 'bar',
}, },
}); });
...@@ -23,18 +21,4 @@ describe('environments empty state', () => { ...@@ -23,18 +21,4 @@ describe('environments empty state', () => {
"You don't have any environments right now", "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