Commit 52a583c1 authored by Rémy Coutable's avatar Rémy Coutable 🔴

Merge branch 'show_push_widget_in_upstream' into 'master'

Show last push widget in upstream after push to fork

## What does this MR do?

Show the last push widget in the upstream project when you push to a fork. 

## Are there points in the code the reviewer needs to double check?

In the view, I'm checking if `@Project` in the first part of the conditional. I felt it was necessary in case `@Project` wasn't an object in all cases. Will it ever not be there? Is this check necessary?

Should there be tests? I don't see existing ones for this. 

## Why was this MR needed?

I use the fork workflow everywhere and it has annoyed me for some time that the last push widget doesn't show up when viewing the upstream project. I'm almost never viewing the fork in GitLab so I want to be able to easily create a MR in any case. 

## Screenshots (if relevant)

**Widget in upstream repo:**


**Widget in fork**:


**Widget on dashboard**:


See merge request !4880
parents 9b75da80 0b34cac1
Pipeline #3661487 passed with stages
in 1233 minutes and 10 seconds
......@@ -29,6 +29,7 @@ v 8.10.0 (unreleased)
- PipelinesFinder uses git cache data
- Throttle the update of `project.pushes_since_gc` to 1 minute.
- Check for conflicts with existing Project's wiki path when creating a new project.
- Show last push widget in upstream after push to fork
- Don't instantiate a git tree on Projects show default view
- Bump Rinku to 2.0.0
- Remove unused front-end variable -> default_issues_tracker
......@@ -293,7 +293,11 @@ module ProjectsHelper
def last_push_event
if current_user
return unless current_user
if fork = current_user.fork_of(@project)
......@@ -7,7 +7,9 @@
%span You pushed to
= link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name) do
%strong= event.ref_name
- if @project && event.project != @project
%span at
%strong= link_to_project event.project
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment