Defect #33896

Incorrect position of the revision graph

Added by Go MAEDA 3 months ago. Updated 23 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:SCM
Target version:-
Resolution:Fixed Affected version:

Description

See the screenshot below. The trunk is affected, 4.1-stable is not affected.

incorrect-position-of-revision-graph.png (155 KB) Go MAEDA, 2020-08-24 04:58

33896.patch Magnifier (2.14 KB) Takenori TAKAKI, 2020-09-04 05:59

before.png (272 KB) Marius BALTEANU, 2020-10-05 00:35

after.png (292 KB) Marius BALTEANU, 2020-10-05 00:35

fix-view-differences-buttons.patch Magnifier (1.1 KB) Mizuki ISHIKAWA, 2020-11-11 05:12


Related issues

Related to Redmine - Feature #33383: Update jQuery to 3.5.1 Closed

Associated revisions

Revision 20147
Added by Go MAEDA about 1 month ago

Incorrect position of the revision graph (#33896, #33383).

Patch by Marius BALTEANU.

Revision 20336
Added by Go MAEDA 23 days ago

Fix that "View differences" buttons on RepositoriesController#diff page does not work due to r20147 (#33896, #33383).

Patch by Mizuki ISHIKAWA.

History

#1 Updated by Go MAEDA 3 months ago

The issue is likely to have been caused by r19803.

#2 Updated by Go MAEDA 3 months ago

#3 Updated by Marius BALTEANU 3 months ago

  • Assignee set to Marius BALTEANU

#4 Updated by Takenori TAKAKI 3 months ago

It seems to be caused by a change in jQuery that changed the value returned from position().top.
The problem seems to be fix, by replacing calculation using offset().top.

#5 Updated by Marius BALTEANU 2 months ago

I think the problem is related to this change: https://jquery.com/upgrade-guide/3.0/#offset.

Takenori, thanks for looking into this, I've tested your patch and it fixes the problem, but looking deeper in the code and in the DOM, I think it's better to fix this by moving the "View differences" buttons outside the autoscroll block. Doing this, we fix another issue generated by the same cause, the buttons are no longer visibile when you scroll to right, please see the attached screenshots.

What do you think about this fix?

diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index 95c6898a1..c7aad5f1e 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -1,3 +1,9 @@
+<% show_diff = revisions.size > 1 && User.current.allowed_to?(:browse_repository, @repository.project) %>
+<% if show_diff %>
+<p>
+  <%= submit_tag(l(:label_view_diff), :name => nil) %>
+</p>
+<% end %>
 <div class="autoscroll">
 <% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
 <%= if show_revision_graph && revisions && revisions.any?
@@ -20,12 +26,6 @@ end %>
        :repository_id => @repository.identifier_param, :path => to_path_param(path)},
       :method => :get
      ) do %>
-<% show_diff = revisions.size > 1 && User.current.allowed_to?(:browse_repository, @repository.project) %>
-<% if show_diff %>
-<p>
-  <%= submit_tag(l(:label_view_diff), :name => nil) %>
-</p>
-<% end %>
 <table class="list changesets">
 <thead><tr>
 <th>#</th>
@@ -53,10 +53,10 @@ end %>
 <% end %>
 </tbody>
 </table>
+<% end %>
+</div>
 <% if show_diff %>
 <p>
   <%= submit_tag(l(:label_view_diff), :name => nil) %>
 </p>
 <% end %>
-<% end %>
-</div>

#6 Updated by Marius BALTEANU 2 months ago

  • Target version set to 4.2.0

#7 Updated by Takenori TAKAKI about 1 month ago

Thanks Marius.
I think your patch is a better improvement.
I felt it was better as a DOM structure as well.

#8 Updated by Go MAEDA about 1 month ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version deleted (4.2.0)
  • Resolution set to Fixed

Committed the patch #33896#note-5. Thank you.

#9 Updated by Mizuki ISHIKAWA 24 days ago

This change resolves the visual probrem, but instead the "View differences" buttons no longer works.
The cause is that submit_tag has been moved out of the form tag.

The attached patch solves the problem by changing the position of the form tag.

#10 Updated by Go MAEDA 24 days ago

  • Status changed from Closed to Reopened

#11 Updated by Go MAEDA 23 days ago

  • Status changed from Reopened to Closed

Mizuki ISHIKAWA wrote:

This change resolves the visual probrem, but instead the "View differences" buttons no longer works.
The cause is that submit_tag has been moved out of the form tag.

Committed the fix in r20336. Thank you.

Also available in: Atom PDF