27 Commits

Author SHA1 Message Date
Viktar Donich
e2d1c6307f Revert "Layout fixes (mostly for Safari)"
This reverts commit 37ef1672f9133b605c5e14f8fbcc241d4c40eb50.

Reason for revert: Got a better idea for app layout, will send follow-up change.

Change-Id: I7bfddcef416d44c7af88d74da6b39c2a93565d32
2016-10-24 20:52:59 +00:00
Viktar Donich
37ef1672f9 Layout fixes (mostly for Safari)
Follow-up for c/89172 for the Safari.

Change-Id: Ifa85f42217f6020991b6644d95d490eb9a8d7b52
2016-10-23 21:28:00 -07:00
Viktar Donich
a7b89441bd Fix app size to make scrollbars visible
Fixes footer at the bottom of the page for all pages and changes
scrolling behavior for diff page.

On the diff page:
- horizontal scrolling is right above footer when required
- all headers stay in place when scrolling

Bug: Issue 4491
Change-Id: I62fdf130376b210c26fadcadc90bf452361ac15d
2016-10-20 12:09:57 -07:00
Becky Siegel
6c06e78cf6 Fix horizontal scrolling in file dropdown, comments, and gr diff view
Previously, long file names would display outside of the window size,
causing a horizontal scroll on mobile browsers.

With this change:
* In the file list on the change view, the rightControls are adjusted so
that they wrap on a new line on smaller/mobile screens.
* In the comment list, word-wrapping is used for long file paths
displayed above each comment.
* In the diff view, instead of displaying full paths in the dropdown,
the path is truncated to include an ellipsis, a slash and the file name
so that it can be seen both in the dropdown and also the native browser
select.

Bug: Issue 4722
Change-Id: Icd4644a45db71bc6666c21d62c864d91e9874654
2016-10-13 15:44:59 -07:00
Kasper Nilsson
bf457dd412 Fix data binding in gr-file-list, introduced in 86117
In https://gerrit-review.googlesource.com/c/86117/ the data binding
between the _files array and the dom-repeat in gr-file-list was not
properly enforced. This change fixes that, and also properly
references a static file-list property.

In addition, tests were implemented to ensure this regression is caught
in the future.

Bug: Issue 4575
Change-Id: I32a5645ec47d953ee6a7a71f4b14fc8c9483df3d
2016-09-30 13:04:15 -07:00
Andrew Bonventre
648121b946 Revert "Add 'Show 75 more' button to gr-file-list"
This reverts commit I84c7fc352da80609d424217250830f19a599c940.

Reason for revert: Neither “Show all diffs” nor the keyboard shortcuts
appear to work. However, clicking on the triangle works.

Original issue's description:
> Add 'Show 75 more' button to gr-file-list
> 
> gr-file-list has an issue handling very large (500+) amounts of files
> due to the dynamic rendering of many DOM elements. This change caps the
> number of files shown initially at 75, and allows the user to view more
> in chunks of 75.
> 
> Also added is a button that allows the user to show all files.
> 
> Bug: Issue 4575
> Change-Id: I84c7fc352da80609d424217250830f19a599c940
> 

Change-Id: I7acfad051e0a255d09ee6e02f9dfc0137d5d37ff
2016-09-27 06:49:54 +00:00
Kasper Nilsson
d311e7f7e6 Add 'Show 75 more' button to gr-file-list
gr-file-list has an issue handling very large (500+) amounts of files
due to the dynamic rendering of many DOM elements. This change caps the
number of files shown initially at 75, and allows the user to view more
in chunks of 75.

Also added is a button that allows the user to show all files.

Bug: Issue 4575
Change-Id: I84c7fc352da80609d424217250830f19a599c940
2016-09-23 12:07:51 -07:00
beckysiegel
c47410c816 Focus and tab between diff preferences inputs
Previously, the diff preferences form did not automatically focus to the
first textfield and did not allow tabbing between input fields. This
change adds autofocus when the overlay is opened and allows for tabbing
between the other input fields in the modal.

Bug: Issue 4140
Change-Id: If15812bb4404ca4061597755eeaf68d4cae23b3f
2016-09-20 18:30:29 -07:00
Andrew Bonventre
04e57d6361 Add next/prev links to the diff view
Bug: Issue 4514
Change-Id: I39927b397fda8d6bb80b7e3a9144e5cfe620fb5a
2016-09-07 18:28:47 -04:00
Kasper Nilsson
0deb7e3fb7 Blur dropdowns after selection
Blurring dropdowns after selection enables a more shortcut-based
workflow.

Bug: Issue 3868
Change-Id: Ie35e5458f10540d0498b32d9bf03f5a6888c2232
2016-08-31 11:42:34 -07:00
Viktar Donich
b34d1f87c7 Show file weblinks (e.g. gitles) in diff view
Bug: Issue 4205
Change-Id: Ib5c832bb29453aa51ebe73732c7b8e6885e7e12f
2016-08-03 14:52:13 -07:00
Viktar Donich
60d8bce771 Release range comments
Remove beta diff setting and enable range comments for all.

Change-Id: I0cee7e1717574ab54317cdce9e2332c8cda7a0cb
2016-07-14 14:45:15 -07:00
Wyatt Allen
a68b48e1f5 Update the URL hash with the selected diff line
Sets the URL hash to the address of the cursor when a user selects a
diff line (either by clicking the line number or using the 'c' hotkey).
If the cursor is on a line of the revision, the address is the line
number. If the cursor is on a line of the base patch, the address is the
letter 'b' followed by the line number. Otherwise the address is the
empty string.

Bug: Issue 4206
Change-Id: Ic85da197eb6264ea1111cc34e781dccbc24d4d40
2016-06-20 14:14:55 -07:00
Viktar Donich
5008b4491f Add a checkbox to hide ranged comments behind
Also adds concept of locally stored preferences.

Change-Id: Ib074a682228d5360a932af696e18967e8e3473be
2016-06-08 15:29:11 -07:00
Wyatt Allen
82ba696dd6 Update the diff mode switcher to use gr-select
Change-Id: I8cdbd4954be759a2fd3901e987b4d73c50983443
2016-06-08 10:29:06 -07:00
Wyatt Allen
88678da403 Add support for images in diffs
If gr-diff recognizes that the file difference it's representing is
between images, it uses a different diff-builder that displays images
in a side-by-side-manner. In this case gr-diff will also make requests
for the image data itself, which it can pass down into the image-based
diff-builder.

Adds methods to gr-rest-api-interface to support rendering the data
relevant to image diffs. For images that are revisions of the current
change, provides "getChangeFileContents". For images that come from the
parent tree (i.e. if the basePatchNum is "PARENT") the interface
provides "getCommitInfo" to determine the SHA of the parent commit, and
"getCommitFileContents" which can get file contents for a given commit.

Bug: Issue 3822
Change-Id: I9be025b4e549fca97c87cdbeede6cb64dea5eac0
2016-05-26 12:02:29 -07:00
Andrew Bonventre
1043bb5212 Vertically align gr-diff-view controls
Change-Id: I769d237885db83c427bb63607cb0278d803597cb
2016-05-24 13:05:16 -04:00
Wyatt Allen
0b6fe19256 Add keyboard shortcuts to diff-view and change-view's inline diffs
Includes the gr-diff-cursor in the relevant views and wires up the
relevant keyboard commands to move the cursor around. Adds the new
keyboard commands to the keyboard shortcuts dialog.

Bug: Issue 4033
Change-Id: If9f63c11d28c7864c64ce8c9cfed6da4fcf4666a
2016-05-18 11:11:02 -07:00
Andrew Bonventre
6c37cf7543 Minor cleanup within change view and diff view
+ Break some things out into functions in change view.
+ Move position of preferences and diff mode toggle.

Change-Id: I2deab3af58193a0bb316e86c8b577a24e9b7a166
2016-05-12 16:17:09 -04:00
Andrew Bonventre
91c6293e3a Support “diff against” in the file list
Bug: Issue 3936
Change-Id: I07f242a8cb7be063a2d56dbe3f4b6a28143588c0
2016-05-11 19:23:01 -04:00
Wyatt Allen
f93f1c24ee Add toggle to PolyGerrit diff view to switch between diff styles
The gr-diff element was already capable of rendering diffs in either
side-by-side or unified style, but was configured by default to use
side-by-side. The GWT diff UI included an icon button toggle to switch
between these two styles above and to the right of the diff near the
"Diff View Preferences" button. This change introduces a selector in the
PolyGerrit UI to allow similar switching behavior.

Previously, the diff mode was encoded as a private property of the
gr-diff element. Now that the switcher is introduced at the same level
as the "Diff View Preferences" button (one level up from the gr-diff
element) it is changed to be a public property of the element so that it
can be changed through the parent view (in this case the gr-diff-view
element).

A dropdown is added to the gr-diff-view based in style on the
gr-patch-range-select element (which plays a similar role). This
dropdown has options for either of the two diff modes and controls the
diff display through a property on the view.

The view gets a new, computed property called _diffMode which encodes
which diff state should be displayed based on the changeViewState and
the user's preferences. The user's choice of diff view is persisted
across diff views, but is reverted to the preference when the change
view is visited.

A test is added to the gr-diff-view element.

Bug: Issue 3909
Change-Id: I00d93500f8d210394acc9c8f3398c9406ae74276
2016-05-09 15:56:23 -07:00
Andrew Bonventre
c80291ca05 Move gr-diff controls into gr-diff-view
This will allow for an easier time in implementing expanding
inline diffs by having gr-diff only responsible for rendering the
diff itself and not other controls.

Change-Id: I254ad5900091c731e2197590d6043c103216785e
2016-04-23 23:28:55 -04:00
Andrew Bonventre
5bee101aa2 Lose the extra horizontal margins on views
Also get rid of some !important declarations since they were
there to deal with a Polymer specificity bug which has since
been fixed.

Change-Id: Ie7bf8682d52ecf05af920c8a7d67701e629f3e59
2016-04-07 22:03:44 -04:00
Andrew Bonventre
30344cc9a3 Remove gr-ajax/gr-request from gr-diff-view
Bug: Issue 3988
Change-Id: Ia34d881e7eb12904971c3cc47cac5aa1dbe08a3f
2016-04-05 16:49:13 -04:00
Andrew Bonventre
cfacb80095 Remove final uses of app.accountReady
Change-Id: I9ed0591d3c0fa673a7bcadbbee0b998b0a57eb05
2016-03-29 14:21:15 -04:00
Andrew Bonventre
2aa22125b6 Move gr-diff-new to gr-diff
Change-Id: Ifaad016f806c31f3df43143b3238b757faa18b20
2016-03-25 17:56:08 -04:00
Andrew Bonventre
78792e8e98 Refactor directory structure of components
There is no change in functionality. Only moving things around.

+ Separate html from the js.
+ Place the unit test for a component within the same folder.
+ Organize the components in subfolders.

Change-Id: I51fdc510db75fc1b33f040ca63decbbdfd4d5513
2016-03-04 18:02:24 -05:00