13 Commits

Author SHA1 Message Date
Kasper Nilsson
eae9f56034 Fix focus stops in diff prefs and reply dialogs
Recent changes aligned PolyGerrit closer with the Material spec, which
moved many dialog actions from being left-aligned to right-aligned, and
with 'reverse' order.

In two cases (gr-diff-preferences and gr-reply-dialog), the focusStops
for the dialog were hardcoded to the first and last focusable DOM
elements in the dialog. When the button order was reversed, these were
not updated.

Bug: Issue 7775
Change-Id: I7faa4e49e9610f0196314a103dd4f5d6b2c1a456
2017-11-20 14:01:39 -08:00
Becky Siegel
8d92d53db5 Annotation updates
Change-Id: I146f76b9dcc1a92e18acec01481ad280fb431868
2017-08-12 11:49:52 -07:00
Kasper Nilsson
90111b882a ES6ify /gr-diff-preferences/*
Bug: Issue 6179
Change-Id: I5a68c4db6d196f5724a5702f7433c41c3cf7b7fd
2017-05-16 14:21:31 -07: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
Wyatt Allen
d970500d62 Annotate trailing whitespace per user preference
Add a simple annotation layer that marks trailing whitespace in diffs
(guarded by the `show_whitespace_errors` diff preference). The newly
supported diff preference is added to both diff preference controls. The
requirement that all annotation layers must implement `addListener` is
relaxed as the trailing whitespace layer is the third layer that doesn't
use it.

Adds tests for the layer and the diff preference.

Feature: Issue 4836
Change-Id: Ifba05216bf0bc3c0a8a094f5ef392b983091d59f
2016-11-20 13:31:30 -08:00
Becky Siegel
e7d19a9976 Add preference for line wrapping in diff preferences
Previously in Polygerrit, diff views were always displayed in the width
specified in diff preferences. This change gives the option to wrap
lines instead, which takes precedence over column width (the column
width option is hidden when line wrapping is selected), and fits the
diff view to screen.

The gerrit API already supports the 'lineWrapping' preference so this
change uses that already existing option.

Feature: Issue 4809
Change-Id: I0d9e292739b5910abfd04af63ec4c745bf06e446
2016-10-31 17:35:21 -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
Wyatt Allen
7c66d99a1c Respect the diff preference for syntax highlighting
Adds checkboxes to both diff preferences controls, adds an `enabled`
boolean property to the `gr-syntax-layer` element, and updates all
relevant tests.

Bug: Issue 4297
Change-Id: I10cef760c354c53e03acfb3c84379e82859ef25f
2016-07-27 11:14:54 -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
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
Andrew Bonventre
1c4369b518 Add diff preferences dialog to gr-new-diff
Change-Id: I3024f46fff0a47e7a4e7a8f5beff9929d8ccb50b
2016-03-24 16:35:07 -04:00
Andrew Bonventre
02f71327cf Add comments/drafts to gr-new-diff
Change-Id: I8110b521ab83a31be5db7e3d65268186485db04d
2016-03-22 11:55:03 -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