26667 Commits

Author SHA1 Message Date
Becky Siegel
8d92d53db5 Annotation updates
Change-Id: I146f76b9dcc1a92e18acec01481ad280fb431868
2017-08-12 11:49:52 -07:00
Becky Siegel
ffd3eb03e7 More rest API closure compiler fixes
Also a few suppressions until the annotations can be resolved.

Change-Id: I4c40a0772f88f5a2b2b8a4bf7479412e462958d3
2017-08-11 14:00:14 -07:00
Kasper Nilsson
c85a1db488 Merge "Show account emails in fast gr-tooltips rather than slow native tooltips" 2017-08-11 18:15:24 +00:00
Alice Kober-Sotzek
b1238d9350 Merge "Extend UpdateUI to support interactive input" 2017-08-11 13:27:27 +00:00
Alice Kober-Sotzek
ea1cefaf2c Merge "ChangeIsVisibleToPredicate: Rearrange try/catch block" 2017-08-11 13:18:00 +00:00
Changcheng Xiao
62dd1b394c Extend UpdateUI to support interactive input
This change extends the existing UpdateUI to make it possible
to read string from users during the schema upgrade process.

One usage of this change is that we can allow administrators to
decide the target change status (work-in-progress or private)
during the migration of draft changes.

Change-Id: I8f7f09618e2bc76129e7fbb9613aa5b90a5e1558
2017-08-11 15:05:29 +02:00
Alice Kober-Sotzek
bbb3708fc0 Merge "Don't retrieve subgroups of not existing group" 2017-08-11 11:38:15 +00:00
Dave Borowitz
d97bdc91f6 ChangeIsVisibleToPredicate: Rearrange try/catch block
This was accidentally shuffled in I8cec3c3c, but NoSuchChangeException
may be thrown by ChangeControl.GenericFactory#controlFor.

Change-Id: If1a8bac25e2641c358be5c94ae461c6cf26425f7
2017-08-11 13:32:35 +02:00
Wyatt Allen
740d8c3854 Show account emails in fast gr-tooltips rather than slow native tooltips
Feature: Issue 6344
Change-Id: I5d7c7983ac0c86b816f5567026a02730bf175c1a
2017-08-10 18:12:24 -07:00
Viktar Donich
92aa1dc60b Merge "Request all commits in the change detail" 2017-08-10 23:07:20 +00:00
Kasper Nilsson
755afb1c10 Merge "Disable reviewed checkbox in diff view for edit" 2017-08-10 22:24:29 +00:00
Kasper Nilsson
5f1f0c6f4e Disable reviewed checkbox in diff view for edit
Modifying the reviewed state of an edit patchset is an illogical action,
and should be disabled.

This change adds an _editLoaded property to gr-diff-view to
conditionally hide the reviewed checkbox. In addition, attempts to
modify the reviewed state are treated as a no-op.

TODO: Further utilize this approach to conditionally show buttons for
modifying an edit patchset. Will be done in a later change.

Bug: Issue 4437
Change-Id: I0ea98e49c5ec66e73f45fef9db5e3849d6e594df
2017-08-10 14:54:57 -07:00
Kasper Nilsson
4cd9917e38 Modify gr-navigation schema to match app.params
_generateUrl in gr-router expected project names to be passed in with
the 'project' property on the params object parameter. However, utility
functions in gr-navigation passed it with the prop name 'projectName' --
this meant that no generated URLs would ever have the project name
supplied.

This change fixes this inconsistency, and modifies the getUrlForChange
function to also supply the project name to generateUrl.

Change-Id: I05c1ef21db16278e0795aee3fb6dbf76601ad6f5
2017-08-10 14:30:21 -07:00
Viktar Donich
c1eb61280d Merge "Update gr-rest-api for closure compilation" 2017-08-10 20:37:04 +00:00
Becky Siegel
99b13d6b58 Update gr-rest-api for closure compilation
Bug: Issue 6914
Change-Id: Ia80373801b3b645c98db9c94e0fa771a3d1ee637
2017-08-10 12:49:39 -07:00
Wyatt Allen
1d43efec61 Merge "PolyGerrit: Hide Audit Log tab from users that are not the group owner" 2017-08-10 19:25:36 +00:00
Wyatt Allen
99e4ad9b07 Merge "Stub inline render function" 2017-08-10 19:18:38 +00:00
Kasper Nilsson
1e452145ba Merge "Use page.redirect instead of history.replaceState" 2017-08-10 18:41:38 +00:00
Kasper Nilsson
d9bcaba215 Merge "Suggest "has:unresolved" in autocomplete" 2017-08-10 18:13:28 +00:00
Wyatt Allen
c7edfca9f9 Merge "Update behavior format for template type safety check" 2017-08-10 18:02:38 +00:00
Becky Siegel
0cac176417 Update behavior format for template type safety check
In order to get type safety check working, behaviors needed to be
refactored so that the behavior assignment contains the actual
behavior object, rather than a reference to the object. This is done
so that the behaviors can easily be passed to fried-twinkie as
additional source files.

Feature: Issue 6914
Change-Id: Ibc4c5b6e2f53498f822be2df5aa41514831e6f5f
2017-08-10 18:01:22 +00:00
Wyatt Allen
a7b86bfe5a Merge "Do not ask for reviewed files when edit is loaded" 2017-08-10 17:58:14 +00:00
Wyatt Allen
40b74b6f5d Stub inline render function
The 'n key presses' suite of gr-file-list tests would trigger async
inline diff rendering by an effect. Because the async rendering is
niether explicitly started nor cancelled, it extends past the lifetime
of the test and render work goes on in the background of the following
test. The processing code called functions which were stubbed when
triggered but were un-stubbed at the end of the test (sometimes before
the async processing had completed). The processing attempts to invoke
such a function the failure is attributed to whichever test is running.

With this change, the async rendering is not triggered in the first
place by setting an additional stub.

Bug: Issue 6949
Change-Id: I06dd2e0c889937a353da30337215c813db32ef42
2017-08-10 10:46:15 -07:00
Kasper Nilsson
80f7661375 Use page.redirect instead of history.replaceState
`history.replaceState` was sometimes called within the router before
page URL state was pushed. This broke the browser back history within
the app.

`page.redirect` instead waits for the current route to push state and
then replaces it with the new one, leaving the browser history clean.

Bug: Issue 6996
Change-Id: I2e64475b4489b8e7685cd03cc8157ce8ce1de630
2017-08-10 10:41:40 -07:00
Alice Kober-Sotzek
834fe7bebd Don't retrieve subgroups of not existing group
Until recently, trying to retrieve the subgroups of a not existing
group simply resulted in an empty collection being returned. That
behavior was exploited in IncludingGroupMembership.

Change-Id: Ie9319a8b705431a53ae4123453cc687444b1bd22
2017-08-10 15:53:41 +02:00
Dave Borowitz
65dc8b6dd8 Remove FieldDef.FillArgs
Supporting this in FieldDef required a lot of unnecessary boilerplate
that was (prior to earlier cleanups in this series) only used by the
change index, no other indexes. This also breaks a dependency edge
between the index package and the rest of gerrit-server, making it more
feasible to factor out a new build rule in the future.

Change-Id: I0785c7e2c93df7951818c3ebaa23e1e988686064
2017-08-10 09:28:57 -04:00
Dave Borowitz
6fe38f4323 Expose AllUsersName from ChangeData for use in ChangeField
This is a little ugly, but allows us to completely get rid of FillArgs
in a followup commit, which is a net win. Another way to think of this
change is exposing "FillArgs" from ChangeData, which already is
injecting a ton of other stuff.

Change-Id: I572d5f4d98af4fe8024b6a5a0ca73577242c9ffb
2017-08-10 09:28:56 -04:00
Dave Borowitz
b6fd88ed23 Remove unused FillArgs#allowsDrafts field
This was only used by an older version of the reviewer field, and was
removed in 783dc965.

Change-Id: I4a71c425cedce3f9ff3ac14eef5e12d126f5b3ff
2017-08-10 09:28:56 -04:00
Dave Borowitz
a4d73b30a0 Add ChangeData#trackingFooters() method
Most current callers of #commitFooters() immediately extract the
tracking footers. Moving TrackingFooters into ChangeData allows us to
avoid injecting this into various other calling classes.

Change-Id: Ib3fc5be98bbe3164ec49c5ed1aedb2e631c9fdab
2017-08-10 09:28:56 -04:00
Dave Borowitz
baefe4b5a4 Cut ChangeData down to 1 constuctor
Even after removing one of the factory methods, there were still 4
assisted injected constructors, which all need to take 17 identical
arguments. Adding more has been painful for a while.

Separate an AssistedFactory class that only has a single method, so we
can keep ChangeData to a single constructor. Convert Factory to a
hand-written Factory that delegates to AssistedFactory as appropriate.

This refactoring made it clear that project can never be null. We can
thus remove OrmException from the project() method, which ripples
outwards.

Change-Id: Id053561ee1e1d8a79b2ce9be501bd69834932ba7
2017-08-10 09:28:55 -04:00
Dave Borowitz
03b46de12a Remove ChangeData factory method used only by old index schemas
Change-Id: I6d004dd0a5ae23d654d073cc7e876e00ebb031c0
2017-08-10 09:17:24 -04:00
Dave Borowitz
62aa816b2f Suggest "has:unresolved" in autocomplete
Change-Id: I385124955c0a0f66059f7a213663a6a11a6aa991
2017-08-10 08:56:43 -04:00
Shawn Pearce
1b15877db6 Merge changes Icca726b5,I91cf6da1,Iea3ba2aa
* changes:
  Add new concept topic, Patch Sets, to documentation
  Add new concept topic on refs/for namespace
  Add new topic, Changes, to documentation
2017-08-10 10:52:45 +00:00
Luca Milanesio
53eab1080b Allow running without gerrit.canonicalWebUrl
Gerrit's CanonicalWebUrl class is already responsible of getting
the full URL from either gerrit.config or the incoming HTTP request.

However, over time, other parts of Gerrit injected directly the
configured string through @CanonicalWebUrl annotation and did not
manage correctly the situation where the configuration is absent.

The only situation where gerrit.canonicalWebUrl is mandatory is
OAuth authentication, because the OAuth provider needs to have
a fixed callback URL with a single hostname.

Change-Id: Idee1d36eb08c53a0d06604b9a737695322e124d1
2017-08-10 08:30:31 +01:00
David Shevitz
5b7a41aa68 Add new concept topic, Patch Sets, to documentation
This concept topic provides conceptual information on what a patch set
is in Gerrit. Its intended audience is Gerrit users who, during the
course of learning how to use Gerrit, want to understand more about
what a Patch Set is, and some of the information the Gerrit Review
screen provides for a patch set.

This topic may eventually need screenshots, but creating them will happen in a
later change.

Change-Id: Icca726b598ce69593ff976c169bb4231244322a5
2017-08-09 19:07:02 -07:00
David Shevitz
d87d84141a Add new concept topic on refs/for namespace
This topic is intended to provide more conceptual/in-depth information
for users. By adding this topic, we have something we can link to in
future how-to and tutorial topics, so we don't have to re-explain
what the refs/for namespace is each time.

This content for this topic originated from several other existing
topics. Those topics are still in place in the documentation. This
duplication is expected, until such a time as the Concepts section
is more complete.

Change-Id: I91cf6da1bdc1f8f53031ab2c0ac2a4c08fb4c0ff
2017-08-09 19:02:17 -07:00
David Shevitz
6493b2f25a Add new topic, Changes, to documentation
This is a new concept topic for the Gerrit documentation. Note that,
while this topic contains a collection of content from a variety of
other topics in the doc set, such as the Review UI topic, the User
Guide topic, and the Project Owner Guide. Those topics will remain,
as they are still useful to users.

This topic is in many ways a reference that future "how-to" topics can
point to. The intended audience is Gerrit users who want more in-depth
information about what a change is, and what information about a change
they can view from the Gerrit UI.

Note: We may add screenshots to this topic in the future.

Change-Id: Iea3ba2aa7cdc77b561cb95f0ea83b1a3193bc281
2017-08-09 18:56:03 -07:00
Kasper Nilsson
4aef830108 Merge "Specify project in URLs" 2017-08-10 00:04:29 +00:00
Wyatt Allen
747c268a8d Request all commits in the change detail
Requesting only the current commit in the change detail serves no
commit if the current revision is not visible. Request commits for all
revisions so that the UI can show the latest visible revision. This
comes with the cost of additional server load in the change detail API.

Bug: Issue 6921
Change-Id: I38bcfb882b66d8ca3c57743746ba21c36570bfb9
2017-08-09 22:24:55 +00:00
Kasper Nilsson
6826659485 Use project lookup
Specifying the project as part of the change ID when the /changes
endpoint is used can help reduce latency significantly.

This change modifies _changeBaseUrl to return a URL that specifies both
the project and the change number. As a portion of this, there may be an
API call made to get the project number (this is unlikely, but
possible). Due to that fact, _changeBaseUrl now returns a promise.

Bug: Issue 6708
Change-Id: I630e521cf6226e579e99aa3dc08cc17239d4dbd4
2017-08-09 14:59:17 -07:00
Kasper Nilsson
0aa254ee22 Do not ask for reviewed files when edit is loaded
Bug: Issue 4437
Change-Id: Ib4cd11bd58aaba9f8b151c3c2319ce90077fba1f
2017-08-09 14:47:19 -07:00
Kasper Nilsson
6c7c8af820 Merge "Add specificity to JSDoc" 2017-08-09 21:18:55 +00:00
Kasper Nilsson
bd26d913a8 Merge changes from topic 'pg-change-editing'
* changes:
  Hide reviewed checkbox when edit is loaded
  Add _editLoaded property to gr-change-view
2017-08-09 21:18:55 +00:00
Kasper Nilsson
a6e98aa797 Merge changes from topic 'pg-change-editing'
* changes:
  Disable diff comments on edit patchsets
  Render change edits on change and diff screens
2017-08-09 21:18:55 +00:00
Kasper Nilsson
6ff2b155c9 Add specificity to JSDoc
Change-Id: I0f5cbc427820426f2a46d7e3cfa8d08a630d0bc5
2017-08-09 21:18:42 +00:00
Kasper Nilsson
5b57a36857 Hide reviewed checkbox when edit is loaded
Modifying the reviewed state of an edit patchset is an illogical action,
and should be disabled.

This change utilizes the _editLoaded property of gr-change-view to
conditionally hide the reviewed checkbox from the file list. In
addition, attempts to modify the reviewed state (e.g. with a hotkey)
are treated as a no-op, and the user is shown a toast.

TODO: Further utilize this approach to conditionally show buttons for
modifying an edit patchset. Will be done in a later change.

Bug: Issue 4437
Change-Id: Iee33d7ebbe0a7182cb91ca6168813154775d9ab4
2017-08-09 21:18:11 +00:00
Kasper Nilsson
9c8cfe5619 Add _editLoaded property to gr-change-view
Computed flag for use in enabling edit-specific actions, like
publishing, discarding, and modifying edits.

First use for this feature is computing whether edit specific buttons
like "Publish" and "Discard" ought to be shown/hidden.

Bug: Issue 4437
Change-Id: I5f9e92d49255f56b49113d4f33d5a61a743db4ea
2017-08-09 21:17:58 +00:00
Kasper Nilsson
380bf8ba6b Disable diff comments on edit patchsets
Includes a minor refactor of gr-diff comment construction logic.

Bug: Issue 4437
Change-Id: I0428fead7a9d1f1dc5d6aa9efc3d81ecbe6b5c64
2017-08-09 21:17:31 +00:00
Shawn Pearce
a69b536264 Merge changes I11562ab1,Id0671530,I51265bdd
* changes:
  Allow additional cookies during xd requests
  Always setLastLoginExternalIdKey for IdentifiedUsers
  Remove duplicate Vary: Access-Control-Request header
2017-08-09 20:08:29 +00:00
Dave Borowitz
69a4e51ad6 Merge "IndexDefinition: Use SiteIndexer instance directly" 2017-08-09 19:49:18 +00:00