3123 Commits

Author SHA1 Message Date
Kasper Nilsson
04784ef40c Revert "Revert "Filter account entry suggestions""
This reverts commit 7f1e82771286d5110be5e85ab6d0cc8bf222accd.

Reason for revert: Fixed issue 8957. `cansee` operator is now only used
in the getSuggestedAccounts request.

Bug: Issue 8722
Change-Id: If204e28afd482dce500dd2e3bc866ef6e3c52984
2018-05-09 10:29:06 +00:00
David Ostrovsky
8e5606c49d PolyGerrit: Fix change edit load on change screen
Revision name "edit" is contained twice in the URL and load change edit
was rejected with 404.

It seems that the problem was a bad rebase during cherry-pick of the
change: I7c7441b2f7 from master to stable-2.15 branch. On master it was
applied correctly, while on stable-2.15 branch double revision name was
added.

Bug: Issue 8940
Change-Id: Icc1c9c761d092602a764b815f08fa592a2a6c497
2018-05-09 08:56:23 +02:00
Paladox none
42d658a16e Merge "Revert "Filter account entry suggestions"" into stable-2.15 2018-05-08 19:16:22 +00:00
Paladox none
594f5ca15d Revert "Filter account entry suggestions"
This reverts commit 56426b62b7df1436e0ec369367b8d6d282d0cd14.

Reason for revert: Was reverted on master

Change-Id: I9edb9c9928d175d3f8f4bf846cc280aba9ca200a
2018-05-08 18:42:36 +00:00
David Pursehouse
5d6ec7c806 gr-change-metadata: Change "Hashtag" label to "Hashtags"
Change-Id: Ie768e70081e33e9435ecb76fd3fb0f891e8e146e
2018-05-07 10:40:26 +09:00
Kasper Nilsson
56426b62b7 Filter account entry suggestions
This change uses the cansee search operator to filter the autocomplete
suggestions to users that may view the current change.

Bug: Issue 8722
Change-Id: I35d48695a23e69fbcc58641e74b8abef6d8ba055
(cherry picked from commit bd1e5e9a194dbef18ca502db5c5564f4863011a4)
2018-05-04 07:46:27 +00:00
Wyatt Allen
e787f97a7b Clear suggestions on autocomplete input change
The gr-autocomplete component re-evaluates suggestions on input changes
via an observer.

Since evaluating suggestions is typically asynchronous (and debounced)
there is a window of time between the keystroke that triggers the
re-evaluation and the time that the new suggestions populate the
`_suggestions` array (potentially replacing any old suggestions).

If a modestly fast typer has typed an input resulting in suggestions,
but then, in quick succession, typed additional text (invalidating the
suggestions and triggering a request for new ones) followed by a
"commit" keystroke (such as [Enter] or [Tab]), then the autocomplete may
incorrectly commit to one of the invalidated suggestions. Doing so would
revert the input value to the text that triggered the old suggestion,
effectively erasing the newly typed characters.

With this change, the suggestion list is eagerly emptied whenever new
input is typed. This ensures that the `_suggestions` array is empty
during the window that new suggestions are inbound.

Bug: Issue 8655
Change-Id: I85bb519985903af719ef287860c04cc97b6cbca8
(cherry picked from commit 8f3fa7532537eb994889b4147aa6b909b40d2c59)
2018-05-03 15:54:43 +00:00
David Pursehouse
dcb0d67c93 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Make zip generation (more) reproducible
  Make _bower_archive rule deterministic

Change-Id: Ic7f059bc53b1a5bb970b8e52708679f9c784c6bf
2018-04-25 08:58:24 +09:00
Han-Wen Nienhuys
ec12294301 Make zip generation (more) reproducible
The 'touch' command uses the system default timezone if none is
supplied. This makes zip files dependent on the timezone of the
generating machine.

Zip by default stores extended attributes (eg. ctime, atime) on Unix
systems. These can be further sources of non-determinism, so switch it
off with --no-extra

Change-Id: I7e102be7368ef339cbaf47524b90688c32a09238
2018-04-25 08:25:31 +09:00
Wyatt Allen
0c1402cc65 Reload actions when new change is loaded, not on new changeNum
In Id4528de9e4, the change actions get reloaded when there is a new
change by reacting to changes in the changeNum or patchNum. However,
the change actions are not based on the selected patch set, instead they
are based on the "latest patch set", and the latest patch set can only
be known when the revisions are loaded (from the change object). As
such, when only the new changeNum was known but the new change object
was not yet loaded, the patchNum based on the change object would be
stale. If the stale patchNum is not valid on the new change this
resulted in a 404 in the actions request.

With this change, the change actions are reloaded when the change object
changes, since this implies that the patchNum will no longer be stale.

Bug: Issue 7622
Change-Id: Ia6fa8ec41b63b02d9f2e6b69cf4225e07b2fae9f
(cherry picked from commit f97f253fa967739eae1b14a3d78498eeadc2f6e4)
2018-04-21 08:29:35 +00:00
Kasper Nilsson
9ea007406e Fix lint errors
ESLint detection of `guard-for-in` errors got better somewhere between
version 4.12.0 and 4.19.1.

This change corrects a few lint errors that may have otherwise
eventually blocked changes on lint CI.

Change-Id: Ieda10dcb68911f64c8689af4ebb9f4e9584caad8
(cherry picked from commit 424422474a4bf6d4f81cd6c092324c34cf1be0c4)
2018-04-21 10:28:11 +02:00
viktard
f069b97336 Merge "Add a check for name in Firefox/Safari" into stable-2.15 2018-04-10 21:32:34 +00:00
viktard
507a0fd981 Merge "Make sure plugins are not double counted" into stable-2.15 2018-04-10 21:32:12 +00:00
Logan Hanks
1f6233131b Merge "Link account chips to owner search rather than user dashboard" into stable-2.15 2018-04-10 17:36:15 +00:00
Logan Hanks
c7b53c9f9b Merge "Add reset button to my menu in settings" into stable-2.15 2018-04-10 17:34:39 +00:00
Logan Hanks
5473dc67c2 Merge "Add a link to group page in groups section of settings" into stable-2.15 2018-04-10 17:31:32 +00:00
Becky Siegel
83dccdf008 Don't curse over files with up/down keys
Previously, if up/down keys were pressed, and the cursor was to move
over files rather than the diff rows, the file list cursor would move up
or down. Because this interfered with the browser's native scrolling
with up/down keys, that behavior has been removed. The j/k keys still
work as they did before.

Bug: Issue 7815
Change-Id: Iaf031f845293a3605a88a9e656eb000b0e4e196f
(cherry picked from commit 7b550ef34b7509e571b764486ede33b0b1b83833)
2018-04-09 19:39:08 +00:00
Paladox none
ce5dc68b80 Add reset button to my menu in settings
Bug: Issue 8375
Change-Id: Icb54c712e1bea6a625aca5e91c87207bf0dbd3b1
(cherry picked from commit 8f4dd2890968b0c6ff08eb051d1f14316b5cfabc)
2018-04-09 19:39:01 +00:00
Becky Siegel
48befe2dc0 Show helpful message when adding group member 404s
Previosuly, 404 errors showed a generic error message, making it unclear
what could have gone wrong. For security reasons, we don't want people
to know if the group does not exist or if the group exists but the user
does not have permission. This change updates the error message to
reflect both of these possibilities.

Bug: Issue 8252
Change-Id: I6940d53b342a81ca10ec78977de4ec548fd10a6f
(cherry picked from commit 01a9e9d4be44d8743f97ddcd232ce203b9b903ec)
2018-04-05 19:33:48 +00:00
Kasper Nilsson
15dc942823 Remove modifierPressed check from change list view
The keybinding for shift+r was erroneously returning every time.
Removing the check allows the keyboard shortcut to work again.

Bug: Issue 8574
Change-Id: Ifb84d4d7347dce28121393b2cdb64cc88c97e8f3
(cherry picked from commit 6b11a72277fb226f3a8dea4b359e36f70356547f)
2018-04-04 15:48:04 +00:00
Becky Siegel
4492acba07 Add a check for name in Firefox/Safari
Change-Id: I89649cb9415d34b769a54a277d51ce722ffe146b
2018-03-29 23:46:21 +01:00
Becky Siegel
db05d1a550 Make sure plugins are not double counted
In the event that a plugin with the same name was attempted to be
installed more than once, the plugin count would double count, and
result in a negative total plugin count.

This prevents actions from taking place, such as opening a popup plugin,
because it verifies that the plugin count is 0 first.

Change-Id: I5805caaa4448117d6ee86f2e2ce5681ab6b6c324
(cherry picked from commit f1d423290e1303138a82ea6ad4d8c054810dacf7)
2018-03-29 23:46:10 +01:00
David Pursehouse
2528abf059 PG: Make convert_for_template_tests.py compatible with Python 3
Add a wrapper method that tries to call open() with Python 3 semantics,
and falls back to Python 2 if it fails.

Bug: Issue 8609
Helped-by: Paladox none <thomasmulhall410@yahoo.com>
Change-Id: Ic46eb31a23506d47edcf6518dc1ccfb274f45c52
2018-03-27 17:12:43 +01:00
Wyatt Allen
ac87f17ef2 Link account chips to owner search rather than user dashboard
Before user dashboards were supported in PG, account links navigated to
an owner query. When user dashboard support was added, account links
started redirecting to the user's dashboard (or the owner query if the
user was logged out).

With this change, account links always link to the owner query, but the
user header that appears over the results shows a link to that user's
dashboard if the viewer is logged in.

Bug: Issue 8237
Change-Id: If0edfb886755c9ae0bb82d990169d04b96bcd57e
(cherry picked from commit 6d4ea5877ddf907fbeb358ee510b8eb28439dff7)
2018-03-26 21:26:50 +00:00
Wyatt Allen
8e32422334 Included-In dialog polish
Add a filter textbox and behavior to the Included-In dialog and align
the padding with other dialogs. To accommodate filtering, empty groups
are hidden.

Change-Id: I481f266ce8cc67de07f1dc8dfb9129b7d36e081b
2018-03-22 11:20:08 +00:00
Paladox
3810c5e7c4 PolyGerrit: Add support for "Included In"
Bug: Issue 6112
Change-Id: I033e3f248a404813b5bc46eeef6bf25b7153bc1a
2018-03-22 11:19:55 +00:00
Kasper Nilsson
037be7266b Make template testing faster
Utilizes a newer version of fried-twinkie that has significant speed
improvements.

Change-Id: I0c80cd35a6e6d79e37e7c8080982e7683f70bf7a
(cherry picked from commit 602ccf222c4993747e17299bb40ace8c80f50af6)
2018-03-22 09:41:57 +00:00
Paladox none
006be55366 Add a link to group page in groups section of settings
Change-Id: If1313fbfdfdaaa60c569c7602b3ae77e30b36234
(cherry picked from commit 51a1cc0dc4c6e34dc59a74df4633f7f0d40798ef)
2018-03-21 20:01:29 +00:00
Gustaf Lundh
56cd578e3c GWT/Poly: Default to "Create initial commit" during project creation
Common support cases for our Gerrit admins stems from users creating
projects without an initial empty commit. The absolute vast majority
of end-users do want an initial commit in their newly created projects,
but sometimes misses to check the "Create initial commit"-checkbox in
the UI. When failing to do so, the situation may be a bit problematic
to remedy for the end user since:

* It is not always clear why they cannot push reviews to their newly
created git.
* It is cumbersome to create an empty root commit for casual git users
* Direct push to refs/heads/* is not always permittable

At our company we have yet to see someone creating an empty commit and
do not want it.

Change-Id: I2462e5fb7dbb68b0816ec25fa0b42ad135a2bb68
2018-02-28 06:54:21 +00:00
Becky Siegel
5562453950 Merge "Consolidate button styles and update disabled" into stable-2.15 2018-02-27 17:50:35 +00:00
Becky Siegel
ec31786da1 Merge "Move Save button to left side and mark as tertiary" into stable-2.15 2018-02-27 17:50:29 +00:00
Becky Siegel
3bbc81c0e5 Merge "Update buttons on overlays" into stable-2.15 2018-02-27 17:50:24 +00:00
Kasper Nilsson
c9095ac513 Fix event targeting in menu-editor
Migrating to paper-button within gr-button caused the property path of
the on-tap event to change (the target moved from gr-button to
paper-button), and the menu editor was not updated to reflect that.

Bug: Issue 8440
Change-Id: I3c40ff9c2dc338e9e905cb25eecb2853a92e5f66
(cherry picked from commit 8c346da3b35f3fd922feba73b4ce90a484950ace)
2018-02-23 20:46:57 +00:00
Becky Siegel
fd2548fb47 Consolidate button styles and update disabled
Mostly general cleanup, also the following changes:
- Disabled flat buttons will have a fully transparent background (before
  it was a partially transparent white background)
- Disabled raised buttons have a (light) grey background and (darker)
  grey text. There is no difference in the disabled styling whether the
  button is primary or not.
- Add loading as a property on gr-button, translate that into disabled
  on the paper-button, which removes some CSS rules.

Bug: Issue 7496
Change-Id: Iae0564d099508827c8f13fbb943c6646d631ce1d
2018-02-22 20:30:10 +00:00
Wyatt Allen
612f8dfcd8 Move Save button to left side and mark as tertiary
The save button is moved to the left side of the reply dialog, is marked
as tertiary so that it's text color becomes black, and is given an
explanatory tooltip.

Bug: Issue 7466
Change-Id: I34b198ec150f4ebaa90e5bc157d7efc393176424
2018-02-22 20:25:28 +00:00
Becky Siegel
7a960de134 Update buttons on overlays
Upate to use 'link' version as per mocks, and align right.

Change-Id: I1955ca3f715f1eea495dde8987d99defab485fbc
(cherry picked from commit 485b91c6ed5902b98bbc0fa25f9d8b7498cdd26a)
2018-02-22 20:25:21 +00:00
Wyatt Allen
00635a9928 Mark all "My" menu links as external
Custom menu links may use URLs that are not covered by the client
router. When following a link that shares the domain, it will be
intercepted by the catchall route and a visual 404 will be mistakenly
shown. With this change, all of the custom links in this menu are marked
as external so that following them causes a full reload and a 404 is
shown only in the appropriate case.

Bug: Issue 8373
Change-Id: I1cad36de97786a0f9af42e08105ab485fa198a15
2018-02-14 20:03:07 +00:00
Logan Hanks
b4cd3067e0 Disable target="_blank" on MyMenu items
Each item of the My menu (called Your in PolyGerrit) is configurable by
the user. There is a target property on each item, but currently no UI
by which the user can set it. Therefore generally we can expect menu
items to receive the default value for this property.

Unfortunately, the default value is contingent on whether the server
thinks the URL is a view in the GWT UI (by looking for a leading '#').
PolyGerrit URLs do not conform to this expectation, so our default menu
items are typically presented by the server as pop-out links.

Previously this wasn't a concern because the top menu didn't support
pop-out links. We introduced support for this with the Documentation
menu in https://gerrit-review.googlesource.com/c/104393/.

Bug: Issue 6109
Bug: Issue 8373
Change-Id: I2455bca5ca6250939ff0a9c3b62679aa6d24dadb
(cherry picked from commit 26bdf6bab524fde3544a68cecc822e8fa6aa45e3)
2018-02-14 20:02:43 +00:00
Paladox none
8b1590e582 Increase template test size for polygerrit
This fixes timeout issues.

Bug: Issue 8314
Change-Id: Id5c6a522b5df791ea715ad2dfaeefc05bb4da75c
(cherry picked from commit 0385951355b00370747985a566c6c0291fcada77)
2018-02-07 18:54:48 +00:00
Paladox none
0af28d3008 Merge "Disallow tabbing on paper-button" into stable-2.15 2018-02-06 19:39:54 +00:00
Becky Siegel
f0ebfdcfc5 Disallow tabbing on paper-button
Because you can already tab through gr-buttons, the paper-button made it
so that each button had two tabs. The tabindex should only be on the
gr-buttons, so disallow on paper-button. For easy demonstration of this
issue, try to tab through the labels on the reply dilog.

Change-Id: Ibc1e7d753f3cda1786d09f81433656c9d3282305
(cherry picked from commit 048e8dc960e1c7df14977fbeaa92d9b983a86236)
2018-02-06 16:45:26 +00:00
Paladox none
d2dc45716f PolyGerrit: Fix gr-diff-view arrows to use html code
See https://www.toptal.com/designers/htmlarrows/

Change-Id: I5255ec40da179292718ade64a93536f27a4fc6a8
(cherry picked from commit 2280cbbcbc432280eea0254ee663c4682d2b9dea)
2018-02-06 14:41:09 +00:00
Becky Siegel
9a3f9bfd48 Fix gr-group-members to add and delete using group id rather than name
Bug: Issue 8194
Change-Id: I588b525fd40c6dbef0a372d103f4cca3ea0466fd
2018-02-06 00:28:58 +00:00
Becky Siegel
4afafc9468 Fix group member URL
Group member URLs are included as part of the getIncludedGroups rest API
call, however a different (incorrect) URL was trying to get computed.
This change fixes the URL issue and also does some HTML clean up.

Bug: Issue 7819
Change-Id: I73bdf4aecc2584f60d888fd04951915705bde255
(cherry picked from commit 7f6b15d6546863c5c47c63eb69e4e7d73db90ade)
2018-02-06 00:28:25 +00:00
Kasper Nilsson
525c98bf3d Reset state flags on loadData calls
In some cases, bound values were setting the flags tracking changes in
gr-account-info. Resetting the flags when loadData is called ensures no
false positives occur.

In addition, upgrades the _usernameChanged logic to compare to the
existing account username value, as opposed to just setting the flag to
true on any modification.

Bug: Issue 7893
Bug: Issue 8287
Change-Id: I75a3cda93bb065a7b9640d4b40905a5e21042bb5
(cherry picked from commit 5cb34e7fa3896a8290023762729690cf15b17ef7)
2018-02-05 16:23:08 +00:00
David Pursehouse
79f8561402 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  ReceiveCommits: Fix NEW_PATCHSET regex pattern
  CreateChangeIT#createNewChangeSignedOffByFooter: Remove unnecessary assume
  CommitValidators: Always check for Change-Id in subject line
  AbstractPushForReview: Factor repeated code to setRequireChangeId method
  Bazel: Use rules_closure from HEAD

Change-Id: I0dd77ea57201e8a3cdc50df21e0039b672ea9b14
2018-02-05 19:04:05 +09:00
David Ostrovsky
c65a3bd3be Bazel: Use rules_closure from HEAD
The latest rules_closure changes updated closure compiler version and
remove stale bazel version check, that broke Bazel CI for gerrit: [1].

It turns out that the current code cannot be compiled by the latest
closure compiler, so that it must be adjusted first. We add two more
suppressions to the closure compiler invocation:

* JSC_UNNECESSARY_ESCAPE
* JSC_JSDOC_MISSING_TYPE_WARNING

Some of the warnings flagged by the closure compiler are related to
the moment library. The PR to fix them is pending for review: [2].

* [1] https://github.com/bazelbuild/bazel/issues/4425
* [2] https://github.com/moment/moment/pull/4350

Change-Id: I0354ceddc7f615d93b5d23cf2652b8552e53cc91
2018-02-04 20:56:19 +00:00
David Pursehouse
0f6ecbe466 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  polygerrit: Add note in README about npm install

Change-Id: Ic67ffc6699ee584d7e83d4af3f5acd2a18b737c2
2018-01-31 08:08:34 +09:00
David Pursehouse
a35fa9012f polygerrit: Add note in README about npm install
When installing web-component-tester fails with the error:

  "EACCES: permission denied, mkdir"

it can be fixed by adding the `--unsafe-perm=true --allow-root` options
as described in [1].

[1] https://github.com/npm/npm/issues/17268#issuecomment-310167614

Change-Id: I397d31209c019ebbe52bf24bd9e359d71863ffd7
2018-01-29 10:20:09 +09:00
Paladox none
e0dd240c58 web-component-tester: Support headless mode
This adds support for running chrome in headless mode.

Support for running firefox in headless mode should work but currently
doesn't.

Moreover, i've added browser option handling to wct [1].

[1] b8388d1a8d

Bug: Issue 8023
Change-Id: I47cd9cd69fc78739219223c74d7b2edf2f97d6c7
(cherry picked from commit f633e0dcacd5f6307ef77b3a40d642310e7e60ee)
2018-01-28 12:35:22 +00:00