Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
92138aff
Commit
92138aff
authored
Mar 22, 2021
by
mgandres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect to the pipeline editor when clicking on CI/CD quick links
parent
658fef82
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
14 deletions
+12
-14
app/presenters/project_presenter.rb
app/presenters/project_presenter.rb
+2
-10
app/views/projects/jobs/_table.html.haml
app/views/projects/jobs/_table.html.haml
+1
-1
changelogs/unreleased/redirect-cicd-quick-buttons-to-pipeline-editor.yml
...leased/redirect-cicd-quick-buttons-to-pipeline-editor.yml
+5
-0
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+1
-1
spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb
...es/projects/show/user_sees_setup_shortcut_buttons_spec.rb
+3
-2
No files found.
app/presenters/project_presenter.rb
View file @
92138aff
...
...
@@ -93,10 +93,6 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
filename_path
(
repository
.
license_blob
&
.
name
)
end
def
ci_configuration_path
filename_path
(
repository
.
gitlab_ci_yml
&
.
name
)
end
def
contribution_guide_path
if
project
&&
contribution_guide
=
repository
.
contribution_guide
project_blob_path
(
...
...
@@ -131,10 +127,6 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
ide_edit_path
(
project
,
default_branch_or_master
,
'CONTRIBUTING.md'
)
end
def
add_ci_yml_path
add_special_file_path
(
file_name:
ci_config_path_or_default
)
end
def
add_readme_path
add_special_file_path
(
file_name:
'README.md'
)
end
...
...
@@ -384,11 +376,11 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
if
cicd_missing?
AnchorData
.
new
(
false
,
statistic_icon
+
_
(
'Set up CI/CD'
),
add_ci_yml_path
)
project_ci_pipeline_editor_path
(
project
)
)
elsif
repository
.
gitlab_ci_yml
.
present?
AnchorData
.
new
(
false
,
statistic_icon
(
'doc-text'
)
+
_
(
'CI/CD configuration'
),
ci_configuration_path
,
project_ci_pipeline_editor_path
(
project
)
,
'btn-default'
)
end
end
...
...
app/views/projects/jobs/_table.html.haml
View file @
92138aff
...
...
@@ -12,7 +12,7 @@
=
s_
(
'Jobs|Use jobs to automate your tasks'
)
%p
=
s_
(
'Jobs|Jobs are the building blocks of a GitLab CI/CD pipeline. Each job has a specific task, like testing code. To set up jobs in a CI/CD pipeline, add a CI/CD configuration file to your project.'
)
=
link_to
s_
(
'Jobs|Create CI/CD configuration file'
),
@project
.
present
(
current_user:
current_user
).
add_ci_yml_path
,
class:
'btn gl-button btn-info js-empty-state-button'
=
link_to
s_
(
'Jobs|Create CI/CD configuration file'
),
project_ci_pipeline_editor_path
(
project
)
,
class:
'btn gl-button btn-info js-empty-state-button'
-
else
.nothing-here-block
=
s_
(
'Jobs|No jobs to show'
)
-
else
...
...
changelogs/unreleased/redirect-cicd-quick-buttons-to-pipeline-editor.yml
0 → 100644
View file @
92138aff
---
title
:
Redirect to the pipeline editor when clicking on CI/CD quick links
merge_request
:
57085
author
:
type
:
changed
spec/features/projects/jobs_spec.rb
View file @
92138aff
...
...
@@ -32,7 +32,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do
it
'shows the empty state page'
do
expect
(
page
).
to
have_content
(
'Use jobs to automate your tasks'
)
expect
(
page
).
to
have_link
(
'Create CI/CD configuration file'
,
href:
project
.
present
(
current_user:
user
).
add_ci_yml_path
)
expect
(
page
).
to
have_link
(
'Create CI/CD configuration file'
,
href:
project
_ci_pipeline_editor_path
(
project
)
)
end
end
...
...
spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb
View file @
92138aff
...
...
@@ -226,11 +226,11 @@ RSpec.describe 'Projects > Show > User sees setup shortcut buttons' do
expect
(
project
.
repository
.
gitlab_ci_yml
).
to
be_nil
page
.
within
(
'.project-buttons'
)
do
expect
(
page
).
to
have_link
(
'Set up CI/CD'
,
href:
pr
esenter
.
add_ci_yml_path
)
expect
(
page
).
to
have_link
(
'Set up CI/CD'
,
href:
pr
oject_ci_pipeline_editor_path
(
project
)
)
end
end
it
'
no "Set up CI/CD" button
if the project already has a .gitlab-ci.yml'
do
it
'
"Set up CI/CD" button is renamed
if the project already has a .gitlab-ci.yml'
do
Files
::
CreateService
.
new
(
project
,
project
.
creator
,
...
...
@@ -247,6 +247,7 @@ RSpec.describe 'Projects > Show > User sees setup shortcut buttons' do
page
.
within
(
'.project-buttons'
)
do
expect
(
page
).
not_to
have_link
(
'Set up CI/CD'
)
expect
(
page
).
to
have_link
(
'CI/CD configuration'
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment