diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 00:08:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 00:08:48 +0300 |
commit | 4d0c47058a89d71d3417ad3bd73781882c8998e8 (patch) | |
tree | 808679f68ca8a8511d12779cf618785d6978be81 /app | |
parent | df2eda3f14dccb703bd7054d4ddde7803cb1fe7e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/projects_helper.rb | 8 | ||||
-rw-r--r-- | app/views/shared/projects/_project.html.haml | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 023790f7d87..5aff12621b5 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -381,6 +381,14 @@ module ProjectsHelper @project.grafana_integration&.enabled? end + def project_license_name(project) + project.repository.license&.name + rescue GRPC::Unavailable, GRPC::DeadlineExceeded, Gitlab::Git::CommandError => e + Gitlab::ErrorTracking.track_exception(e) + + nil + end + private def get_project_nav_tabs(project, current_user) diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index 07a61b71b8e..144bb04e2a8 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -14,6 +14,7 @@ - updated_tooltip = time_ago_with_tooltip(project.last_activity_date) - css_controls_class = compact_mode ? [] : ["flex-lg-row", "justify-content-lg-between"] - avatar_container_class = project.creator && use_creator_avatar ? '' : 'rect-avatar' +- license_name = project_license_name(project) %li.project-row.d-flex{ class: css_class } = cache(cache_key) do @@ -40,10 +41,10 @@ %span.metadata-info.visibility-icon.append-right-10.prepend-top-8.text-secondary.has-tooltip{ data: { container: 'body', placement: 'top' }, title: visibility_icon_description(project) } = visibility_level_icon(project.visibility_level, fw: true) - - if explore_projects_tab? && project.repository.license + - if explore_projects_tab? && license_name %span.metadata-info.d-inline-flex.align-items-center.append-right-10.prepend-top-8 = sprite_icon('scale', size: 14, css_class: 'append-right-4') - = project.repository.license.name + = license_name - if !explore_projects_tab? && access&.nonzero? -# haml-lint:disable UnnecessaryStringOutput |