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
6301bd24
Commit
6301bd24
authored
Dec 01, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preload tags when loading commit statuses
parent
4c7be6fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
app/models/ci/legacy_stage.rb
app/models/ci/legacy_stage.rb
+1
-0
app/presenters/ci/legacy_stage_presenter.rb
app/presenters/ci/legacy_stage_presenter.rb
+23
-0
app/views/projects/stage/_stage.html.haml
app/views/projects/stage/_stage.html.haml
+4
-2
No files found.
app/models/ci/legacy_stage.rb
View file @
6301bd24
...
...
@@ -5,6 +5,7 @@ module Ci
# We should migrate this object to actual database record in the future
class
LegacyStage
include
StaticModel
include
Presentable
attr_reader
:pipeline
,
:name
...
...
app/presenters/ci/legacy_stage_presenter.rb
0 → 100644
View file @
6301bd24
# frozen_string_literal: true
module
Ci
class
LegacyStagePresenter
<
Gitlab
::
View
::
Presenter
::
Delegated
presents
:legacy_stage
def
preloaded_statuses
legacy_stage
.
statuses
.
tap
do
|
statuses
|
# rubocop: disable CodeReuse/ActiveRecord
ActiveRecord
::
Associations
::
Preloader
.
new
.
preload
(
preloadable_statuses
(
statuses
),
:tags
)
# rubocop: enable CodeReuse/ActiveRecord
end
end
private
def
preloadable_statuses
(
statuses
)
statuses
.
reject
do
|
status
|
status
.
instance_of?
(
::
GenericCommitStatus
)
||
status
.
instance_of?
(
::
Ci
::
Bridge
)
end
end
end
end
app/views/projects/stage/_stage.html.haml
View file @
6301bd24
-
statuses
=
stage
.
present
(
current_user:
current_user
).
preloaded_statuses
%tr
%th
{
colspan:
10
}
%strong
...
...
@@ -6,8 +8,8 @@
=
ci_icon_for_status
(
stage
.
status
)
=
stage
.
name
.
titleize
=
render
sta
ge
.
sta
tuses
.
latest_ordered
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
allow_retry:
true
=
render
sta
ge
.
sta
tuses
.
retried_ordered
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
retried:
true
=
render
statuses
.
latest_ordered
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
allow_retry:
true
=
render
statuses
.
retried_ordered
,
stage:
false
,
ref:
false
,
pipeline_link:
false
,
retried:
true
%tr
%td
{
colspan:
10
}
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