42 Commits

Author SHA1 Message Date
Paladox none
2280cbbcbc PolyGerrit: Fix gr-diff-view arrows to use html code
See https://www.toptal.com/designers/htmlarrows/

Change-Id: I5255ec40da179292718ade64a93536f27a4fc6a8
2017-04-21 16:41:59 +00:00
Becky Siegel
7a45400e24 Move diff overlay to gr-diff-preferences
Previously, gr-diff-preferences was the contents that was displayed in
an overlay contained in the gr-diff-view.  There were a handful of
functions that crossed between the two-- the diff preferences element
would fire events that needed to be handled by the diff view.

Because the gr-diff-preferences element will be added to the change
view as well, the overlay has been moved to be part of the diff
preferences element. This way, the element can handle all of the actions
taken by the panel, and all the parent element needs to do is call
the open function.

A separate change will come with the addition of diff preferences in the
change view.

Bug: Issue 5426
Change-Id: Id7396147e73354122ea3825bde2c324b5daa1d26
2017-04-19 13:25:25 -07:00
Paladox none
8b0d046dfb Fix PolyGerrit URLs to support prefixed URL
This updates most of polygerrit links to use the implementation added in
I2b2d704fe33c90ea2f2a2183fc79897642a48175 .

Change-Id: Ib3bb694969e903fd76a1dad13cfb642bde086142
2017-04-13 23:44:31 +01:00
Paladox none
d43abe9fe8 Adds a up button to diff's screen in polygerrit
GWT UI has this button but polygerrit dosen't. Makes it easier to view
your other diff's if you need to pick another file but it is way down
the list.

Change-Id: Ic62480315b3b00d7623d4ac444a0b554d255b4d1
2017-03-31 15:53:51 +00:00
Viktar Donich
3dd0ff4dd0 Fix dropdown bug on page scroll
Hard to describe, here's the bug:
http://imgur.com/a/O3aTl

Change-Id: I2d8b3f6258d3be5a135efbd7f00edb2ef8d8f102
2017-03-13 15:07:18 -07:00
Becky Siegel
fe99e263f6 Don't wrap prev/next text on diff view
This change prevents the wrapping of prev/next text in the diff view so
that the links are placed consistently on each page.

Bug: Issue 5195
Change-Id: Ic5a2c896858c00e43b8506b227c80458a3b85aed
2017-01-03 11:53:55 -08:00
Becky Siegel
a2ea634774 Changes to diff view for mobile
- Hide download link and file web links from patchsets.
- Add a full file path.
- Change next/prev buttons to be arrows on either side of full path
- Change subheader to flex/wrap so that the display mode wraps to the
next line instead of the second patch set item.

Bug: Issue 5114
Change-Id: Iefb8afe9d7e2417f8aa2070e52073708c052fa4f
2016-12-19 14:44:20 -08:00
Kasper Nilsson
d01ad017e4 Fix improper implementation of getKeyboardEvent
Bug: Issue 5088
Change-Id: Iee82c135230f78f823c25982aaeba1ea6ece1709
2016-12-09 11:00:44 -08:00
Andrew Bonventre
a289623b51 Don’t cause scrollbar to hide when dropdowns are shown
Bug: Issue 5095
Bug: Issue 4808
Change-Id: I92d0cd0f0217bcef18bb0b7346112a7d6c5b99bf
2016-12-08 09:15:20 -08:00
Andrew Bonventre
4d22c7e835 Cleanup: use iron-a11y-keys-behavior for keyboard shortcuts
+ This does not cover on-keydown handlers within elements.
  A follow-up change will account for those.
+ Keyboard shortcuts are disabled within gr-overlay, input,
  and textarea elements.
+ Added tests for new behavior (plus some missing ones covering
  broken behavior).
+ Removed blur hacks used on elements to placate the kb
  shortcuts due to restrictions that have been removed.

Bug: Issue 4198
Change-Id: Ide8009a3bfc340a35a8ec8b9189a85b49c8a95aa
2016-11-17 15:27:59 -08:00
Kasper Nilsson
3ea4311f66 Utilize patch set description in PG
This change adds the patch set description, if it exists, in every patch
set select in the change view and the diff view. Also includes
refactoring of an existing function into a behavior for use in other
files, and removes some unnecessary DOM nodes from the change-view.

http://imgur.com/a/rEhOF

Feature: Issue 4544
Change-Id: Id5f8d2d5750f3f7afc677e16c411327f53487b19
2016-11-11 10:47:37 -08:00
Andrew Bonventre
4b60a0bd7e Merge changes I63f4aa2e,I805f31b2
* changes:
  Revert "Make horizontal scrolling visible on diff page"
  Revert "Allow diff to scroll for inline diff"
2016-11-02 19:20:23 +00:00
Viktar Donich
bcab19889b Revert "Make horizontal scrolling visible on diff page"
This reverts commit 52c943d88e088894e61e054964ec91ffe410a0bc.

Change-Id: I63f4aa2efd386300c070521c5bccf1c6ac5c594e
2016-11-02 19:10:30 +00:00
Wyatt Allen
20693de09f Properly encode file path in diff view
Bug: Issue 4827
Change-Id: Ia0815aca6649324fe9f3ad7c5e2168c25d1f8a7d
2016-11-01 16:11:07 -07:00
Kasper Nilsson
c59e88058e Add raw diff download link to PG diff-view
A dependent change added the ability to download a single file diff to
Gerrit. This change utilizes that new feature via a download link in the
diff-view.

Feature: Issue 4669
Change-Id: I87ef2324ff2cd7fab6eb4b2e066dd08defe7c4f0
2016-10-31 18:06:51 -07:00
Viktar Donich
52c943d88e Make horizontal scrolling visible on diff page
Diff header scrolls with content and sticks to the top.
Implemented custom gr-header wrapper to accomodate this.

Bug: Issue 4491
Change-Id: I451ecd4f6c454fd9ab3085ad8f9c5bdd27cb9269
2016-10-28 12:31:58 -07:00
Viktar Donich
cc6b8300d1 Revert "Fix app size to make scrollbars visible"
This reverts commit a7b89441bda7a1ea7e98969462c2def989bd68c2.

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

Change-Id: I7b7c86288fb070114e76dd68701e05c539089eab
2016-10-24 20:53:30 +00: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