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
43042095
Commit
43042095
authored
Apr 29, 2021
by
Robert May
Committed by
Igor Drozdov
Apr 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache parts of the home_panel partial [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
7172e12e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
37 deletions
+55
-37
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+42
-37
changelogs/unreleased/home-panel-tag-caching.yml
changelogs/unreleased/home-panel-tag-caching.yml
+5
-0
config/feature_flags/development/cache_home_panel.yml
config/feature_flags/development/cache_home_panel.yml
+8
-0
No files found.
app/views/projects/_home_panel.html.haml
View file @
43042095
...
...
@@ -2,6 +2,7 @@
-
show_auto_devops_callout
=
show_auto_devops_callout?
(
@project
)
-
max_project_topic_length
=
15
-
emails_disabled
=
@project
.
emails_disabled?
-
cache_enabled
=
Feature
.
enabled?
(
:cache_home_panel
,
type: :development
,
default_enabled: :yaml
)
.project-home-panel.js-show-on-project-root.gl-my-5
{
class:
[(
"empty-project"
if
empty_repo
)]
}
.gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3
...
...
@@ -23,42 +24,45 @@
-
if
current_user
%span
.access-request-links.gl-ml-3
=
render
'shared/members/access_request_links'
,
source:
@project
-
if
@project
.
tag_list
.
present?
%span
.home-panel-topic-list.mt-2.w-100.d-inline-flex.gl-font-base.gl-font-weight-normal.gl-align-items-center
=
sprite_icon
(
'tag'
,
css_class:
'icon gl-relative gl-mr-2'
)
-
@project
.
topics_to_show
.
each
do
|
topic
|
-
project_topics_classes
=
"badge badge-pill badge-secondary gl-mr-2"
-
explore_project_topic_path
=
explore_projects_path
(
tag:
topic
)
-
if
topic
.
length
>
max_project_topic_length
%a
{
class:
"#{ project_topics_classes } str-truncated-30 has-tooltip"
,
data:
{
container:
"body"
},
title:
topic
,
href:
explore_project_topic_path
,
itemprop:
'keywords'
}
=
topic
.
titleize
-
else
%a
{
class:
project_topics_classes
,
href:
explore_project_topic_path
,
itemprop:
'keywords'
}
=
topic
.
titleize
-
if
@project
.
tag_list
.
present?
=
cache_if
(
cache_enabled
,
[
@project
,
:tag_list
],
expires_in:
1
.
day
)
do
%span
.home-panel-topic-list.mt-2.w-100.d-inline-flex.gl-font-base.gl-font-weight-normal.gl-align-items-center
=
sprite_icon
(
'tag'
,
css_class:
'icon gl-relative gl-mr-2'
)
-
if
@project
.
has_extra_topics?
.text-nowrap.has-tooltip
{
data:
{
container:
'body'
},
title:
@project
.
has_extra_topics?
?
@project
.
topics_not_shown
.
join
(
', '
)
:
nil
}
=
_
(
"+ %{count} more"
)
%
{
count:
@project
.
count_of_extra_topics_not_shown
}
-
@project
.
topics_to_show
.
each
do
|
topic
|
-
project_topics_classes
=
"badge badge-pill badge-secondary gl-mr-2"
-
explore_project_topic_path
=
explore_projects_path
(
tag:
topic
)
-
if
topic
.
length
>
max_project_topic_length
%a
{
class:
"#{ project_topics_classes } str-truncated-30 has-tooltip"
,
data:
{
container:
"body"
},
title:
topic
,
href:
explore_project_topic_path
,
itemprop:
'keywords'
}
=
topic
.
titleize
-
else
%a
{
class:
project_topics_classes
,
href:
explore_project_topic_path
,
itemprop:
'keywords'
}
=
topic
.
titleize
-
if
@project
.
has_extra_topics?
.text-nowrap.has-tooltip
{
data:
{
container:
'body'
},
title:
@project
.
has_extra_topics?
?
@project
.
topics_not_shown
.
join
(
', '
)
:
nil
}
=
_
(
"+ %{count} more"
)
%
{
count:
@project
.
count_of_extra_topics_not_shown
}
.project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-start.gl-flex-wrap.gl-mt-5
-
if
current_user
.gl-display-flex.gl-align-items-start.gl-mr-3
-
if
@notification_setting
.js-vue-notification-dropdown
{
data:
{
button_size:
"small"
,
disabled:
emails_disabled
.
to_s
,
dropdown_items:
notification_dropdown_items
(
@notification_setting
).
to_json
,
notification_level:
@notification_setting
.
level
,
help_page_path:
help_page_path
(
'user/profile/notifications'
),
project_id:
@project
.
id
}
}
=
cache_if
(
cache_enabled
,
[
@project
,
:buttons
,
current_user
,
@notification_setting
],
expires_in:
1
.
day
)
do
.project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-start.gl-flex-wrap.gl-mt-5
-
if
current_user
.gl-display-flex.gl-align-items-start.gl-mr-3
-
if
@notification_setting
.js-vue-notification-dropdown
{
data:
{
button_size:
"small"
,
disabled:
emails_disabled
.
to_s
,
dropdown_items:
notification_dropdown_items
(
@notification_setting
).
to_json
,
notification_level:
@notification_setting
.
level
,
help_page_path:
help_page_path
(
'user/profile/notifications'
),
project_id:
@project
.
id
}
}
.count-buttons.gl-display-flex.gl-align-items-flex-start
=
render
'projects/buttons/star'
=
render
'projects/buttons/fork'
.count-buttons.gl-display-flex.gl-align-items-flex-start
=
render
'projects/buttons/star'
=
render
'projects/buttons/fork'
-
if
can?
(
current_user
,
:download_code
,
@project
)
%nav
.project-stats
.nav-links.quick-links
-
if
@project
.
empty_repo?
=
render
'stat_anchor_list'
,
anchors:
@project
.
empty_repo_statistics_anchors
-
else
=
render
'stat_anchor_list'
,
anchors:
@project
.
statistics_anchors
(
show_auto_devops_callout:
show_auto_devops_callout
)
=
cache_if
(
cache_enabled
,
[
@project
,
:download_code
],
expires_in:
1
.
minute
)
do
%nav
.project-stats
.nav-links.quick-links
-
if
@project
.
empty_repo?
=
render
'stat_anchor_list'
,
anchors:
@project
.
empty_repo_statistics_anchors
-
else
=
render
'stat_anchor_list'
,
anchors:
@project
.
statistics_anchors
(
show_auto_devops_callout:
show_auto_devops_callout
)
.home-panel-home-desc.mt-1
-
if
@project
.
description
.
present?
...
...
@@ -80,11 +84,12 @@
=
render_if_exists
"projects/home_mirror"
-
if
@project
.
badges
.
present?
.project-badges.mb-2
-
@project
.
badges
.
each
do
|
badge
|
%a
.gl-mr-3
{
href:
badge
.
rendered_link_url
(
@project
),
target:
'_blank'
,
rel:
'noopener noreferrer'
}
>
%img
.project-badge
{
src:
badge
.
rendered_image_url
(
@project
),
'aria-hidden'
:
true
,
alt:
'Project badge'
}
>
=
cache_if
(
cache_enabled
,
[
@project
,
:badges
],
expires_in:
1
.
day
)
do
.project-badges.mb-2
-
@project
.
badges
.
each
do
|
badge
|
%a
.gl-mr-3
{
href:
badge
.
rendered_link_url
(
@project
),
target:
'_blank'
,
rel:
'noopener noreferrer'
}
>
%img
.project-badge
{
src:
badge
.
rendered_image_url
(
@project
),
'aria-hidden'
:
true
,
alt:
'Project badge'
}
>
changelogs/unreleased/home-panel-tag-caching.yml
0 → 100644
View file @
43042095
---
title
:
Cache project tag list
merge_request
:
57031
author
:
type
:
performance
config/feature_flags/development/cache_home_panel.yml
0 → 100644
View file @
43042095
---
name
:
cache_home_panel
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57031
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/328421
milestone
:
'
13.12'
type
:
development
group
:
group::source code
default_enabled
:
false
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