Get commentlinks per-project in UI code
Remove commentlinks from GerritConfig and instead provide them in JSON form from GET /projects/X/config. On the client side, create new CommentLinkProcessor instances when loading a change or patch. Fortunately, even though this requires another RPC to get the project config, in all existing screen instances, there is already an RPC we can parallelize it with. In the long term we may want to enable server-side HTML rendering, but that requires enabling this option on a variety of RPC endpoints, not all of which are converted to the new REST API. In addition, there is the problem of defining a stable HTML fragment style. For example, the commit message template is currently implemented using a not-quite-trivial template in GWT's UiBinder, so some of that formatting and styling would need to be hoisted out into the server side; doable, but we're not there yet. Change-Id: Iaecbeff939c8fcbc1c6f500e0b04ce03f35e1fd3
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
package com.google.gerrit.client.changes;
|
||||
|
||||
import com.google.gerrit.client.ui.CommentLinkProcessor;
|
||||
import com.google.gerrit.common.data.AccountInfoCache;
|
||||
import com.google.gerrit.common.data.SubmitTypeRecord;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
@@ -37,10 +38,11 @@ public class ChangeDescriptionBlock extends Composite {
|
||||
}
|
||||
|
||||
public void display(Change chg, Boolean starred, Boolean canEditCommitMessage,
|
||||
PatchSetInfo info,
|
||||
final AccountInfoCache acc, SubmitTypeRecord submitTypeRecord) {
|
||||
PatchSetInfo info, AccountInfoCache acc,
|
||||
SubmitTypeRecord submitTypeRecord,
|
||||
CommentLinkProcessor commentLinkProcessor) {
|
||||
infoBlock.display(chg, acc, submitTypeRecord);
|
||||
messageBlock.display(chg.currentPatchSetId(), starred,
|
||||
canEditCommitMessage, info.getMessage());
|
||||
canEditCommitMessage, info.getMessage(), commentLinkProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user