11 Commits

Author SHA1 Message Date
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