Skip to content
代码片段 群组 项目
提交 ee0d71cb 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Merge branch 'mg-env-approval-cta-20230719' into 'master'

Link to environment detail page for deployment approvals

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126981



Merged-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarCarla Drago <cdrago@gitlab.com>
Co-authored-by: default avatarManuel Grabowski <mgrabowski@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -12,9 +12,10 @@ def illustration ...@@ -12,9 +12,10 @@ def illustration
{ {
image: 'illustrations/manual_action.svg', image: 'illustrations/manual_action.svg',
size: 'svg-394', size: 'svg-394',
title: _('Waiting for approval'), title: _('Waiting for approvals'),
content: format( content: format(
_("This job deploys to the protected environment \"%{environment}\" which requires approvals."), _("This job deploys to the protected environment \"%{environment}\", which requires approvals. " \
"You can approve or reject the deployment on the environment details page."),
environment: subject.deployment&.environment&.name environment: subject.deployment&.environment&.name
) )
} }
...@@ -33,11 +34,11 @@ def action_title ...@@ -33,11 +34,11 @@ def action_title
end end
def action_button_title def action_button_title
_('Go to environments page to approve or reject') _('View environment details page')
end end
def action_path def action_path
project_environments_path(subject.project) project_environment_path(subject.project, subject.deployment&.environment)
end end
def action_method def action_method
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:build) { create(:ci_build, :manual, environment: 'production', project: project) } let(:build) { create(:ci_build, :manual, environment: 'production', project: project) }
let(:environment) { create(:environment, name: 'production', project: project) }
before do before do
stub_licensed_features(protected_environments: true) stub_licensed_features(protected_environments: true)
environment = create(:environment, name: 'production', project: project)
create(:protected_environment, project: project, name: 'production', required_approval_count: 1) create(:protected_environment, project: project, name: 'production', required_approval_count: 1)
create(:deployment, :blocked, project: project, environment: environment, deployable: build) create(:deployment, :blocked, project: project, environment: environment, deployable: build)
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
end end
it 'displays a button linking to the environments page' do it 'displays a button linking to the environments page' do
expect(page).to have_text('Waiting for approval') expect(page).to have_text('Waiting for approvals')
expect(page).to have_link('Go to environments page to approve or reject', href: project_environments_path(project)) expect(page).to have_link('View environment details page', href: project_environment_path(project, environment))
find("[data-testid='job-empty-state-action']").click find("[data-testid='job-empty-state-action']").click
expect(page).to have_current_path(project_environments_path(project)) expect(page).to have_current_path(project_environment_path(project, environment))
end end
end end
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
end end
it { expect(subject.illustration).to include(:image, :size) } it { expect(subject.illustration).to include(:image, :size) }
it { expect(subject.illustration[:title]).to eq('Waiting for approval') } it { expect(subject.illustration[:title]).to eq('Waiting for approvals') }
it do it do
expect(subject.illustration[:content]).to include('This job deploys to the protected environment "production"') expect(subject.illustration[:content]).to include('This job deploys to the protected environment "production"')
...@@ -63,10 +63,15 @@ ...@@ -63,10 +63,15 @@
end end
describe '#action_button_title' do describe '#action_button_title' do
it { expect(subject.action_button_title).to eq('Go to environments page to approve or reject') } it { expect(subject.action_button_title).to eq('View environment details page') }
end end
describe '#action_path' do describe '#action_path' do
before do
environment = create(:environment, name: 'production', project: project)
create(:deployment, :blocked, project: project, environment: environment, deployable: build)
end
it { expect(subject.action_path).to include('environments') } it { expect(subject.action_path).to include('environments') }
end end
......
...@@ -21361,9 +21361,6 @@ msgstr "" ...@@ -21361,9 +21361,6 @@ msgstr ""
msgid "Go to environments" msgid "Go to environments"
msgstr "" msgstr ""
   
msgid "Go to environments page to approve or reject"
msgstr ""
msgid "Go to epic" msgid "Go to epic"
msgstr "" msgstr ""
   
...@@ -47429,7 +47426,7 @@ msgstr "" ...@@ -47429,7 +47426,7 @@ msgstr ""
msgid "This job depends on upstream jobs that need to succeed in order for this job to be triggered" msgid "This job depends on upstream jobs that need to succeed in order for this job to be triggered"
msgstr "" msgstr ""
   
msgid "This job deploys to the protected environment \"%{environment}\" which requires approvals." msgid "This job deploys to the protected environment \"%{environment}\", which requires approvals. You can approve or reject the deployment on the environment details page."
msgstr "" msgstr ""
   
msgid "This job does not have a trace." msgid "This job does not have a trace."
...@@ -50807,6 +50804,9 @@ msgstr "" ...@@ -50807,6 +50804,9 @@ msgstr ""
msgid "View documentation" msgid "View documentation"
msgstr "" msgstr ""
   
msgid "View environment details page"
msgstr ""
msgid "View exposed artifact" msgid "View exposed artifact"
msgid_plural "View %d exposed artifacts" msgid_plural "View %d exposed artifacts"
msgstr[0] "" msgstr[0] ""
...@@ -51468,7 +51468,7 @@ msgstr "" ...@@ -51468,7 +51468,7 @@ msgstr ""
msgid "Wait for the file to load to copy its contents" msgid "Wait for the file to load to copy its contents"
msgstr "" msgstr ""
   
msgid "Waiting for approval" msgid "Waiting for approvals"
msgstr "" msgstr ""
   
msgid "Waiting for merge (open and assigned)" msgid "Waiting for merge (open and assigned)"
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册