25424 Commits

Author SHA1 Message Date
Edwin Kempin
f01d46d903 Merge "Make methods in AccountPredicates public" 2017-06-06 15:27:46 +00:00
Edwin Kempin
7c1ec889cf AccountCache: Remove unused getIfPresent
Change-Id: Id5689dc5a42de257915e960a46cfaca080dff06f
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-06 17:21:02 +02:00
Edwin Kempin
b34596f01d ExternalIdsConsistencyChecker: Use AccountCache#getOrNull to check if account exists
Using AccountCache#getIfPresent to check if an account exists is wrong:

1. It returns null for existing accounts that were not cached yet.

2. It returns an empty AccountState instance for missing accounts that
were requested from the cache before and that are still in the cache.

Change-Id: Ie25b44c53f92720053274cd56e68058e148d389e
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-06 17:21:02 +02:00
Edwin Kempin
642ce7084c AccountCache: Add getOrNull method that returns null for missing account
AccountCache#get returns an empty AccountState instance to represent a
missing account. Add a new AccountCache#getOrNull method that returns
null if an account is missing so that callers can special-case
non-existing accounts.

Change-Id: I51dcca79a4ec3ec71a09c9ec0da51fda03e19928
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-06 17:21:02 +02:00
Edwin Kempin
734f8a3b14 AccountCache: Document get and getIfPresent methods
Some callers make wrong assumptions about these methods. Documenting
these methods can help to avoid confusion.

Change-Id: I23b9f69c9e18c8de201f53d2a2db1f1e3aa7075c
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-06 17:15:07 +02:00
Dave Borowitz
d0c01fd381 Document that *WebLink impls may return null
Change-Id: Ia88e6072a7a22ff3beb982eb212fdcf6f29022dc
2017-06-06 10:47:08 -04:00
Dariusz Luksza
17ad3df4d9 Allow to use AccountCache out of request scope
Before change I13f2d6ab94 AccountCache could be used out of the request
scope. Using Provider<ReviewDb> in ByNameReviewDbLoader class implicitly
add new constraint on AccountCache, namely it must be used in request
scope.

Injecting SchemaFactory<ReviewDb> instead of Provider fixes this
regression.

Change-Id: I398e02cb138302cd99a2fb68fadcc4d6c6176395
Signed-off-by: Dariusz Luksza <dluksza@collab.net>
2017-06-06 10:40:23 +00:00
Edwin Kempin
a83b1072d1 Make methods in AccountPredicates public
Plugins need access to these methods if they want to use these
predicates in an internal query with
InternalAccountQuery#query(List<Predicate<AccountState>>).

Change-Id: Ie70cd35f35bde942cd377a1db1cac2388b565686
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-06 11:49:39 +02:00
David Pursehouse
56bcc7737c Merge "Revert "Make ExternalIdCache public for plugins"" 2017-06-06 07:48:57 +00:00
David Pursehouse
e3488058ab Revert "Make ExternalIdCache public for plugins"
After discussion it was agreed that this is not necessary.

This reverts commit 35b94328b400f5ca95f66de474b5b0a884f8c497.

Change-Id: Ibb4d956483c63f4431a2bc986d4f28a99fac0b25
2017-06-06 07:19:14 +00:00
Edwin Kempin
1bd4658582 Merge "ChangeEditUtil: Remove extra reindex after publishing" 2017-06-06 06:34:46 +00:00
Viktar Donich
5bbf192fc8 Integration test for LGTM plugin
Change-Id: Ic57e518df1acbabac476846865ee05ba42a62721
2017-06-05 18:54:17 -07:00
Viktar Donich
207a0eb901 Make selected label values always be strings
Initial values setup resulted in label values (eg "+2") to be
numbers (ie 2), and was changing to strings by iron-select upon user
changing label value.

With this change, gr-label-score-row.selectedValue returns string or
null if not selected. This is needed for consistency of the plugin API.

Change-Id: Ia1ca49de498a9a0552740c6ad1aad8acd21c4f3b
2017-06-05 18:53:36 -07:00
David Pursehouse
b71c56a0c9 Merge "Merge branch 'stable-2.14'" 2017-06-06 01:00:25 +00:00
Wyatt Allen
fb8315a450 Merge changes I19a0c153,I1037c43d
* changes:
  Fix filter so that it works with shadow DOM
  Consolidate list-view code
2017-06-06 00:45:28 +00:00
Wyatt Allen
e40fe5a4d8 Merge "Fix gr-account-info styles in shadow DOM" 2017-06-06 00:40:43 +00:00
Wyatt Allen
27a7a367b1 Merge "Add polygerrit-ui/app/test/common-test-setup.html" 2017-06-06 00:40:15 +00:00
David Pursehouse
9552ec8226 Merge branch 'stable-2.14'
* stable-2.14:
  Introduce GlobalPluginConfig{s} annotations
  Clarify usage of @GerritConfig#value() and #values()
  Clarify usage of GerritConfig#name()
  GerritServer: Split annotation sanity check to a separate method

Change-Id: I8c7e145ec4ddacd049f7d908fd74dcf0046c677e
2017-06-06 09:37:41 +09:00
Becky Siegel
6db67fd93a Fix gr-account-info styles in shadow DOM
The shared styles were not applied, so the hidden overriding style
was not applied.

Bug: Issue 6372
Change-Id: Ia3b0ff100b7431fa85595901216954f925068f2c
2017-06-06 00:26:44 +00:00
Becky Siegel
2ce461e802 Fix filter so that it works with shadow DOM
on-input did not work in shadow-dom, replace with observer.

Change-Id: I19a0c153fcbc46956be9276b94e613c46bb7c0ed
2017-06-06 00:25:55 +00:00
Becky Siegel
56fbb55325 Consolidate list-view code
Throughout the admin section, there are (at least) three distinct list
views that behave very similarly. This change helps share code between
them:

Create a list-view element that handles the filtering and navigation,
and styles <content></content>,  which is the same among lists.

Change-Id: I1037c43df7be58aa00843d29cae50495e089826d
2017-06-05 17:24:15 -07:00
Becky Siegel
0606f77983 Merge "Add gr-textarea to the reply dialog" 2017-06-05 23:38:54 +00:00
Becky Siegel
c637fbdeea Add gr-textarea to the reply dialog
This replaces iron-autogrow-textarea so that the reply dialog can have
emoji support.

Change-Id: I75f24a88a64c4bc82f0d254d2aa73d1d9b52a6e6
2017-06-05 23:28:57 +00:00
Becky Siegel
9f90ef5398 Merge "Fix gr-dropdown styles for shadow dom" 2017-06-05 23:28:41 +00:00
Wyatt Allen
121c85cea5 Merge "Fix padding on gr-tooltip with shadow DOM" 2017-06-05 23:23:35 +00:00
Becky Siegel
787bc4d964 Merge "Fix various selectors for shadow dom" 2017-06-05 23:22:55 +00:00
Becky Siegel
06f2dbbd10 Fix padding on gr-tooltip with shadow DOM
The global * style in main.css took precedence over the padding applied
to :host. Instead add a wrapper div to apply padding there.

Bug: issue 6732
Change-Id: I57cec6b2a016d34a17993a0f2583e48a94dbc74e
2017-06-05 23:21:48 +00:00
Becky Siegel
a4fc6de235 Fix various selectors for shadow dom
https://www.polymer-project.org/2.0/docs/devguide/style-shadow-dom

Bug: Issue 6372
Change-Id: I1918e86b31d4fa02b67d1b0e5ef9ae8f48877257
2017-06-05 22:42:22 +00:00
Mike Samuel
e07c4b2ea1 Add polygerrit-ui/app/test/common-test-setup.html
This is a partial roll-forward of c/106190

This replaces all loads of iron-test-helpers with a load of a file
that wraps it, and adds that file to test files that do not currently
load iron-test-helpers.

A future CL will also install polymer-resin via common-test-helpers.html.

I tested by running

$ WCT_ARGS="-l chrome" ./polygerrit-ui/app/run_test.sh

Change-Id: Ifb3cd2c8db13d724f57e56e7e78045470d103a43
2017-06-05 22:10:12 +00:00
Becky Siegel
d86455a660 Add list-style-type to gr-formatted-text
The reset removed it, but it should have real bullet points.

Change-Id: If2e007f00ac6e5ca74913ed656e92202fa724866
2017-06-05 14:31:17 -07:00
Becky Siegel
e606b45c09 Fix gr-dropdown styles for shadow dom
Some of the styles needed parentheses added to target shadow dom
elements.

Bug: Issue 6372
Change-Id: I4761947fbd0ee8d0d888f0a1fe2ab25c6b2a4a24
2017-06-05 14:04:59 -07:00
Becky Siegel
ea5f288bd2 Add project as property to fix polylint warning
Bug: Issue 6394
Change-Id: Ic38513d31147c16be1004301b0e7509fc58e8edf
2017-06-05 12:56:42 -07:00
Wyatt Allen
92be0eda80 Merge "Close race condition that mixed content from other diffs" 2017-06-05 18:42:03 +00:00
Kasper Nilsson
dbbef0e0a8 Merge "Admin link updates" 2017-06-05 18:38:00 +00:00
Becky Siegel
dec6522db7 Admin link updates
- Renames 'admin' to 'more'.
- Lets unauthenticated users view the 'projects' page.

Change-Id: I28c29e4387cac1470453f6a69360bfa124bb5b13
2017-06-05 10:18:40 -07:00
Becky Siegel
80b9777e01 Merge "PolyGerrit: Implement /admin/groups page" 2017-06-05 16:58:39 +00:00
Kasper Nilsson
6bf0f57151 Merge "Reload page in shadow dom if cookie is set" 2017-06-05 16:36:20 +00:00
Wyatt Allen
21e6b7f207 Close race condition that mixed content from other diffs
Previously, when a diff was reloaded, it would clear the diff content
(the previous diff) and open requests for the data regarding the new
diff. When the requests finished, it would cancel async processing and
start it again on the new data. In this arrangement, a narrow race
condition was present where the async rendering could emit a diff from
the previous diff after the diff table had been cleared, but before the
network requests resolved -- resulting is content form the previous diff
appearing in the new one.

With this change, the async processing is cancelled at the same time
that the diff content is cleared.

Bug: Issue 6170
Change-Id: Ie5a807082ab51156595f9eeb9ba6c958d41e890a
2017-06-05 09:19:00 -07:00
Dave Borowitz
76a22b9598 ChangeEditUtil: Remove extra reindex after publishing
This is the one change edit operation that uses BatchUpdate, which
already takes care of reindexing.

Change-Id: Ic75c6e7197956362303bf7cc956ae6263d4c8c2e
2017-06-05 11:30:25 -04:00
David Pursehouse
52e337f818 Introduce GlobalPluginConfig{s} annotations
GlobalPluginConfig and GlobalPluginConfigs can be used to annotate
test methods in plugin tests, to provide test configuration values
in $site/etc/plugin-name.config.

The annotations work in the same way as existing GerritConfig{s}, with
addition of "pluginName" parameter.

A limitation of these annotations is that they must be used together
with @UseLocalDisk, so that the plugin configuration files may be
written in the site's etc folder.

Change-Id: I11a66eac87bec5f849858d1a4f38d3f01976ff47
2017-06-05 11:51:33 +00:00
Luca Milanesio
35b94328b4 Make ExternalIdCache public for plugins
Publicize the accounts external ids cache so that plugins
can inject Gerrit's implementation and benefit from
a speedy and transparent access to user's external ids.

Change-Id: I437f7a3a429423f9442822cee8d16f29a628833c
2017-06-05 06:11:26 +00:00
David Pursehouse
6e1131c763 Clarify usage of @GerritConfig#value() and #values()
If the value() is given, it takes precedence over values(), i.e.
values() is ignored if value() is specified.

Add Javadoc and a test to clarify this behavior.

Change-Id: I1bf8bd732f973a8d7106601d54680728ad1e0763
2017-06-03 15:25:43 +09:00
David Pursehouse
d2a95d21c0 Clarify usage of GerritConfig#name()
Add Javadoc to clarify that the name() parameter of the @GerritConfig
annotation can be used to specify settings like:

 [section]
   name = value

aswell as

 [section "subsection"]
   name = value

Also update the tests to use values that make this usage clearer, and
add extra tests to cover the subsection functionality.

Change-Id: Id06d811a26b0127c1bf0540514537b696c457a46
2017-06-03 15:11:52 +09:00
Becky Siegel
1ca9c34f91 Merge "Only reset margin and padding for inputs" 2017-06-03 02:31:46 +00:00
David Pursehouse
4a618f5d0b GerritServer: Split annotation sanity check to a separate method
Change-Id: Ie9ecdc29054093f5e29261d159177c02fc260b1b
2017-06-03 10:25:00 +09:00
Becky Siegel
8c494070d4 Only reset margin and padding for inputs
There were a few instances in the app where borders previously existed
that they don't now. For example, the projects filter, and the rebase
dialog.

Change-Id: I94b3271f7553e3afa095b8442165aa0a9678e573
2017-06-02 17:23:02 -07:00
Becky Siegel
36310e3ca9 Reload page in shadow dom if cookie is set
This will be used for internal testing/usage of Shadow DOM, since there
will likely be many things that look mildly broken when running the app
with shadow dom.

Change-Id: I2cf5fafd7a5b00886df199a1bbf29cf284f43499
2017-06-02 17:11:28 -07:00
Becky Siegel
71978816bf Add shared style to gr-label-score-row
Change-Id: Ic0ca54b4903253cfd01e1c31c2921e91aef9eeec
2017-06-02 16:26:40 -07:00
Paladox none
fea8d95cd3 PolyGerrit: Implement /admin/groups page
Bug: Issue 6325
Change-Id: I409d8ef44d33ab8ac89a42c57cbba94c6ee5bd82
2017-06-02 23:15:26 +00:00
Becky Siegel
66994bc52c Add selected text to label picker
If no item is selected (and has no default), add 'No value selected'
text, so that the empty space doesn't look strange.

Bug: Issue 6306
Change-Id: I5c779416b7f330b2d683509a22b905ee8194557d
2017-06-02 23:11:09 +00:00