135 Commits

Author SHA1 Message Date
Becky Siegel
8b3e97f3c8 Fix next button on gr-admin-project-list
Previously, the logic assumed that the API request would fetch all
projects, not just the current page. In order to properly display the
next button, modify the API request to ask for one result than wanted,
but only display the original number desired. If the full amount + 1 is
returned, there should be a next button.

Change-Id: I67c6fb9cd6009220a1d9ac24fe4506bd6383428e
2017-05-26 09:59:32 -07:00
Paladox none
2719063a1e PolyGerrit: Show a list of projects on /admin/projects page
When going to /admin/projects/test for example it will take you back
to the old ui to view the project configs.

Bug: Issue 5966
Change-Id: I7d6fb8f17a235602bba0c535cfe4b43030f515a3
2017-05-25 11:53:05 -07:00
Kasper Nilsson
fbad19e18e Catch-all fix for merged linter errors
Bug: Issue 6179
Change-Id: I436b6dbd88e83b4d901d5446a0c7900678be157d
2017-05-17 17:17:25 -07:00
Logan Hanks
7dc37c3893 Merge "Move reviewer updates back in time to appear before reply message" 2017-05-17 18:34:14 +00:00
Viktar Donich
b288dc1361 Move reviewer updates back in time to appear before reply message
Feature: Issue 5984
Change-Id: I75974028180e06fa18f8e1ba5b8a1f2ea9885010
2017-05-17 10:55:15 -07:00
Viktar Donich
9f047389f4 UI for comments deletion by admins
This change depends on API implemented in Change 105052.

Feature: Issue 4644
Change-Id: I91137aaa69eef419e08c8a568cef9350d8a1448b
2017-05-17 10:29:08 -07:00
Kasper Nilsson
cfa942a78b ES6ify /gr-rest-api-interface/*
Bug: Issue 6179
Change-Id: I27e4b8a39b63d794388f027c817ef12ae1b1d504
2017-05-16 19:27:04 +00:00
Wyatt Allen
75bf2ce32e Merge "Remove polyfilled image API" 2017-05-11 17:27:41 +00:00
Wyatt Allen
26880b6f09 Remove polyfilled image API
Bug: Issue 5751
Change-Id: Ie668e79dfe5762799f46e9f77fbb8239155a08de
2017-05-11 17:27:03 +00:00
Logan Hanks
dc65dde7d5 Add "Start review" workflow using work_in_progress
Feature: Issue 3799
Feature: Issue 5310
Change-Id: I262c156b0155d1b64b84a9df91279979b41daede
2017-05-09 13:31:42 -07:00
Wyatt Allen
e30596b677 Polyfill parent-indexed change file API
When loading image diffs as API support for parent-indexed change files
rolls out, request the fast version first and fall back to the existing,
slower version if that fails.

Bug: Issue 5751
Change-Id: I1d3916e2fdfda66a7925825c6b3fbfbf178b4c36
2017-05-05 10:35:14 -07:00
Kasper Nilsson
e3dc6b2a72 Migrate /gr-rest-api-interface/*_test.html to ES6
Change-Id: Ic6cc03579bbad81f6a2528ae2ce51739126e61fd
2017-05-03 15:32:51 -07:00
David Pursehouse
e8815eb126 Use -is:ignored predicate in dashboard queries
Now we have a specific predicate for finding ignored changes, we can use
that instead of the 'star:ignore' query.

Change-Id: I0c47fea273514a9117f20606d7202a6d1a153aa2
2017-04-28 11:29:09 +02:00
Aaron Gable
31e324a579 URLEncode email when removing reviewer
This is necessary to allow email addresses with '+' in them
to be properly understood by the backend.

Bug: issue 6066
Change-Id: Ifc79310d0a20a72b9c208a031e4a5bdd6da7a7e1
2017-04-25 14:24:56 -07:00
David Pursehouse
f7355e2cdd Merge branch 'stable-2.14'
* stable-2.14:
  Add PolyGerrit probe of /Documentation/index.html

Change-Id: I27b911c41a8df31507ba3fa43a1557b9ea240963
2017-04-25 17:22:08 +02:00
Logan Hanks
0ed845c7de Add PolyGerrit probe of /Documentation/index.html
Change-Id: I5817e033e1620e5f28a339e57699b366956037e5
2017-04-25 16:28:17 +02:00
Paladox none
132bfcbf4c 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-19 09:33:58 +00:00
David Pursehouse
cae3c5ef56 Merge "Implement inline edit REST API in PolyGerrit" 2017-04-19 08:56:45 +00:00
Paladox none
3b7af51d1d Implement inline edit REST API in PolyGerrit
This doesn't hook it up to the GUI but adds the REST API in PolyGerrit.

Bug: Issue 4437
Change-Id: I88dc71af9b3f2658d90af7794d56a0cae30c5f13
2017-04-18 23:14:57 +00:00
Becky Siegel
79db377a37 Fix lint errors
Change-Id: I5f92b7a578f39dc27869ccee9706938706cb8ad2
2017-04-17 13:49:27 -07:00
Viktar Donich
737881d957 Collection of prospective test flake fixes
Potentially related:
https://github.com/Polymer/web-component-tester/issues/505

Bug: Issue 5792
Change-Id: I9ab6e8e40d9811dd52906335426764c052907609
2017-04-14 18:56:41 +00: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
Becky Siegel
7fe6a3b4cc Don't show binary image content & fix image label
Previously there were times when binary data from an image diff would
display. This change adds a check in the diff processor for image diffs
and does not display anything other than the file line in that case.

This change also addresses an issue where the label is calculated too
soon. The image size (if it exists) is supposed to be included as part
of the label, but often this was calculated before the image was done
rendering, so it didn't display.

Bug: Issue 5887
Change-Id: I9cd1ad0c3f2603492d7d84892147bd6852bbae29
2017-03-31 10:11:16 -07:00
Viktar Donich
29e1ce5e84 Collection of prospective test flake fixes
Potentially related:
https://github.com/Polymer/web-component-tester/issues/505

Bug: Issue 5792
Change-Id: I9ab6e8e40d9811dd52906335426764c052907609
2017-03-30 13:46:58 -07:00
Paladox none
819343f9c9 PolyGerrit: Bug fix for iOS 10.3 and mac 10.12.4
https://bugs.webkit.org/show_bug.cgi?id=169970

There seems to be a bug in iOS 10.3 that if the header is undefined
everything fails. That's fixed in safari 10.2 which is not in safari 10.1
on iOS 10.3.

We can revert this when the fix makes it into iOS 10.3.

Bug: Issue 5715
Change-Id: I7c027b5bf90c67d15541188120b202aa965cf1d5
(cherry picked from commit 37140336228faaa6ff13892954bbbd425fed8a08)
2017-03-30 00:19:48 +00:00
Paladox none
3714033622 PolyGerrit: Bug fix for iOS 10.3 and mac 10.12.4
https://bugs.webkit.org/show_bug.cgi?id=169970

There seems to be a bug in iOS 10.3 that if the header is undefined
everything fails. That's fixed in safari 10.2 which is not in safari 10.1
on iOS 10.3.

We can revert this when the fix makes it into iOS 10.3.

Bug: Issue 5715
Change-Id: I7c027b5bf90c67d15541188120b202aa965cf1d5
2017-03-28 14:41:19 +00:00
Wyatt Allen
99b3b045cd Reload page when refreshed credentials differ
When credentials are refreshed, but the new credentials are for a
different account than before, the entire page is reloaded. In this way,
the available UI actions will correspond to the new user's capabilities.

Bug: Issue 5820
Change-Id: I48ff608b2e68d284b6bbcf4f843f64d3390136a8
2017-03-22 14:45:08 -07:00
Viktar Donich
a7ad680e55 Merge "Test stale credentials on visibility change" 2017-03-22 21:19:35 +00:00
Wyatt Allen
516d08a4bd Test stale credentials on visibility change
When returning to a page after a long time, test the credentials
immediately after the page has been foregrounded and show the auth-toast
if they are found to be expired.

Currently, while the user is expected to be refreshing their
credentials, the GR-ERROR-MANAGER listened to `visibilityChange` events
to hasten authentication checks. With this change, the error manager
always listens to `visibilityChange` events (rather than only when
refreshing). In response to these events it will:
- Check the credential refresh status (if the user is expected to be
  refreshing credentials).
- Validate the user's credentials (if the credentials have not been
  validated recently).
- Otherwise do nothing.

Change-Id: Ic9c0a739043cf7b35b89219739fd9bc5dba51634
2017-03-22 11:08:02 -07:00
Becky Siegel
0727efa3d1 Implement isOnParent as functions rather than an attribute on comments
Previously, the rest api interface set '__isOnParent' for comments.
When comments were added, the property from the comment thread
'isOnParent' was passed as a property. When the draft was saved, it was
expecting '__isOnParent' rather than 'isOnParent' and this caused
comments to show up on the wrong side after saved/refreshed, because
'__isOnParent' was undefined.

Instead of changing to either '__isOnParent' which would be strange to
pass as an attribute or 'isOnParent' which would look like it came from
the api directly, this change introduces isOnParent functions so that
translation doesn't need to be done with the API.

Bug: Issue 5831
Change-Id: I3b849ba5878275cda0a39638626a12bd51341a29
2017-03-21 14:57:58 -07:00
Becky Siegel
cd2d4232f1 Reduce confusion between side and commentSide
Use '__isOnParent' as a boolean in place if 'side' ('PARENT vs
'REVISION').  In doing so, it's necessary to convert to/from 'side'
whenever interacting with the REST API.

Change-Id: Ic023c9be1969597e4b9c73a51cfed9f5eb9bc23e
2017-03-15 13:50:21 -07:00
Becky Siegel
61ecc0cf10 Update gr-confirm-rebase-dialog with tailored options
The three rebase options are
1. Rebase on parent change
2. Rebase on top of the <branch name> branch
3. Rebase on a specific change or ref

Scenarios:

Has parent, can rebase on parent
- Show all 3 options. Second two options show "breaks relation chain"
  message.

Has parent, can't rebase on parent
- Instead of option 1, show message that is up to date with parent.
- Show second two options with "breaks relation chain" message.

Has no parent, can rebase on parent (tip of branch)
- Do not show option 1, nor dipslay message in its place.
- Show second two options without "breaks relation chain" message.

Has no parent, can't rebase on parent (tip of branch)
- Do not show option 1, nor dipslay message in its place.
- Instead of option, show message that change is up to date with tip of
  branch already
- Show option 3  without "breaks relation chain" message.

Because 'hasParent' isn't immediately known when change actions are
displayed, the rebase button will also remain disabled until this
becomes known.

Bug: Issue 5447
Change-Id: I45ef8241a75c1f5d197ed64e51b19c5ce74d0227
2017-02-22 22:32:39 +00:00
Becky Siegel
2ac8aaf87e Add admin menu skeleton
Previously, people using Polygerrit did not realize how to access admin
functionality in GWT. This build out a skeleton menu, and displays the
appropriate menu items based on role. The page itself will still show
the default admin view placeholder.

Bug: Issue 5470
Change-Id: I1266dd8fb70d0afac485f1e547fae85acee7e5aa
2017-02-16 08:58:29 -08:00
Wyatt Allen
81edbb9811 Merge "Add hasParent attribute to change view/change actions/rebase dialog" 2017-02-15 20:38:11 +00:00
Becky Siegel
bb3acdb083 Add hasParent attribute to change view/change actions/rebase dialog
Get a hasParent attribute from the related changes endpoint, determining
if a change has a parent change that is not the tip of the branch.
This will be used by the rebase dialog to display tailored options
that make rebasing more intuitive. UI changes to follow.

This change also updates rebaseOnCurrent from being a property of
gr-change-view to getting added in the rest api interface as a property
of the rebase action.  This is why the property is removed from all
views until the reply dialog, where it is passed as a parameter.

Bug: Issue 5447
Change-Id: If31e4c42d8e82f00fba9fa98c28371046299eec4
2017-02-14 14:28:55 -08:00
Han-Wen Nienhuys
7a4df91e60 Remove password GET calls from PolyGerrit.
Change-Id: Id37ca140101289ef1014169efbf8b387c19d2694
2017-02-09 17:52:55 +01:00
Wyatt Allen
cf4894d14f Pass cookies when fetching binary files
Some Gerrit instances will require cookies in order to serve binary
content requests, but the use of `fetch` for `_fetchB64File` in
GR-REST-API-INTERFACE did not have the credential option set, and would
fail on such instances. With this change the credentials option is set.

Bug: Issue 5371
Change-Id: I5f8e8fd74bb3775bda00217fabac38031d010e05
2017-02-07 18:03:08 -08:00
Wyatt Allen
c4817a446c Merge "Fix race between comment saving and reply dialog" 2017-02-08 00:55:38 +00:00
Kasper Nilsson
6cff0e60d6 Fix race between comment saving and reply dialog
In some cases, the reply dialog could be opened before all comment
drafts have been saved, causing the draft to not appear in the dialog.

This change maintains an array corresponding to each draft request and
refers to it before opening the reply dialog. If the array is populated,
a non-blocking alert is shown with the text 'Try again when all comments
have saved.'

Bug: Issue 5369
Change-Id: Ieb73e7d7b4f66daff6cc2278a84c2195b7d0e541
2017-02-07 16:41:50 -08:00
Becky Siegel
cea68b09f3 Fix range issue when there is a base patch that is not parent
Change-Id: I24d1f063bb6abacd1fdcfc7289762d5061a8337e
2017-02-08 00:27:54 +00:00
Wyatt Allen
f218daf010 Merge "Add status field to settings view" 2017-02-07 23:12:48 +00:00
Kasper Nilsson
85875740f4 Add status field to settings view
This change allows the user to modify their status via the settings
view.

Feature: Issue 4394
Change-Id: I07f721a13b150968e5fc795afeadbc7322e620b7
2017-02-07 11:11:59 -08:00
Becky Siegel
8c19a02e67 Fix range issue with comment replies
- Adds range when parent exists when comment POSTed
- Finds range via filtering comments for backfill

Bug: Issue 5459
Change-Id: Ied19cc4b33749ba81fad6d1a5030abab419b1e6f
2017-02-06 17:03:57 -08:00
Viktar Donich
0f1296ffe6 Do not parse partially filled changes for reviewer updates
Skip reviewer updates grouping for changes that:
- don't have messages
- don't have reviewer updates

Issue 5421

Change-Id: I3edcc3f5b1110506be5f23fcdf37a6bf40fc70c9
2017-02-02 12:39:52 -08:00
Viktar Donich
7b6c299141 Group reviewer updates in the UI (integrate)
Picks up grouped reviewer updates and shows them in gr-message-list.

Bug: Issue 4383, Issue 5256
Change-Id: If799717294e806eccad4087b19566fd15618c600
2017-02-01 09:56:34 -08:00
Viktar Donich
95c868e1fd Group reviewer updates in the UI (parser)
Introduces GrReviewerUpdatesParser that processes individual reviewer
updates and groups them. This essentially moves implementation from
/c/94490/ to client side to gather requirements ahead of server-side
implementation. Ultimately, this class will simply be removed once
server-side generates grouped updates.

Sequential updates are grouped if:
- They were performed within short timeframe (6 seconds)
- Made by the same person
- Non-change updates are discarded within a group
- Groups with no-change updates are discarded (eg CC -> CC)

Bug: Issue 4383, Issue 5256
Change-Id: Ieb405d4b5562294adb23bdd14879e9e67737890f
2017-01-31 21:23:17 -08:00
Kasper Nilsson
9bbd47c24a Support assignee field in PolyGerrit
Adds max-count prop to gr-account-list and utilizes it to create the
Assignee field in gr-change-metadata with autocompletion.

Feature: Issue 5229
Change-Id: Ifc796703322ff6d68040d10e0294e7aa8f6ce0ea
2017-01-10 14:25:11 -08:00
Viktar Donich
14ef76a1c6 Handle email confirmation links in PolyGerrit
Handles #/VE/token links from confirmation emails sent by Gerrit by
redirecting to /settings/VE/token and validating the token using REST API.

Errors and success messages are shown as a pop-up toast using gr-alert
via show-alert DOM event handled by gr-error-manager.

Feature: Issue 4196
Change-Id: Ia6d40894512cd77b4d19f88668af15c68f03b10d
2016-12-29 16:51:16 -08:00
Wyatt Allen
f446363803 Normalize download_scheme preference to lower case in PG
Bug: Issue 5180
Bug: Issue 5142
Change-Id: Ic946e0b11b2eceb2568b1f6f33981682c65fd1e1
2016-12-20 15:34:26 -08:00
Wyatt Allen
18406b5b85 Merge "Move diff view defaults to the rest api interface" 2016-12-16 18:33:08 +00:00