Consistently use camelCase in Gerrit Client
In the Gerrit Client classes that represent the JSON entities retrieved from the server we have a mix of camelCase and underscore_case method names. Make it consistent by always using camelCase. Change-Id: I5ba3a0e52bbfc6d1b9d224461b8a45952ab93b3a Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
committed by
Edwin Kempin
parent
baa72847a4
commit
0ec1e17477
@@ -72,7 +72,7 @@ public class AvatarImage extends Image implements LoadHandler {
|
|||||||
} else if (isGerritServer(account)) {
|
} else if (isGerritServer(account)) {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
setResource(Gerrit.RESOURCES.gerritAvatar26());
|
setResource(Gerrit.RESOURCES.gerritAvatar26());
|
||||||
} else if (account.has_avatar_info()) {
|
} else if (account.hasAvatarInfo()) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
AvatarInfo info = account.avatar(size);
|
AvatarInfo info = account.avatar(size);
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
@@ -121,7 +121,7 @@ public class AvatarImage extends Image implements LoadHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isGerritServer(AccountInfo account) {
|
private static boolean isGerritServer(AccountInfo account) {
|
||||||
return account._account_id() == 0
|
return account._accountId() == 0
|
||||||
&& Util.C.messageNoAuthor().equals(account.name());
|
&& Util.C.messageNoAuthor().equals(account.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ public class FormatUtil {
|
|||||||
StringBuilder b = new StringBuilder().append(name);
|
StringBuilder b = new StringBuilder().append(name);
|
||||||
if (info.email() != null) {
|
if (info.email() != null) {
|
||||||
b.append(" <").append(info.email()).append(">");
|
b.append(" <").append(info.email()).append(">");
|
||||||
} else if (info._account_id() > 0) {
|
} else if (info._accountId() > 0) {
|
||||||
b.append(" (").append(info._account_id()).append(")");
|
b.append(" (").append(info._accountId()).append(")");
|
||||||
}
|
}
|
||||||
return b.toString();
|
return b.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.google.gwt.core.client.JavaScriptObject;
|
|||||||
import com.google.gwt.core.client.JsArray;
|
import com.google.gwt.core.client.JsArray;
|
||||||
|
|
||||||
public class AccountInfo extends JavaScriptObject {
|
public class AccountInfo extends JavaScriptObject {
|
||||||
public final native int _account_id() /*-{ return this._account_id || 0; }-*/;
|
public final native int _accountId() /*-{ return this._account_id || 0; }-*/;
|
||||||
public final native String name() /*-{ return this.name; }-*/;
|
public final native String name() /*-{ return this.name; }-*/;
|
||||||
public final native String email() /*-{ return this.email; }-*/;
|
public final native String email() /*-{ return this.email; }-*/;
|
||||||
public final native String username() /*-{ return this.username; }-*/;
|
public final native String username() /*-{ return this.username; }-*/;
|
||||||
@@ -29,7 +29,7 @@ public class AccountInfo extends JavaScriptObject {
|
|||||||
* available, such as when no plugin is installed. This method returns
|
* available, such as when no plugin is installed. This method returns
|
||||||
* false if the server did not check on avatars for the account.
|
* false if the server did not check on avatars for the account.
|
||||||
*/
|
*/
|
||||||
public final native boolean has_avatar_info()
|
public final native boolean hasAvatarInfo()
|
||||||
/*-{ return this.hasOwnProperty('avatars') }-*/;
|
/*-{ return this.hasOwnProperty('avatars') }-*/;
|
||||||
|
|
||||||
public final AvatarInfo avatar(int sz) {
|
public final AvatarInfo avatar(int sz) {
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
|
|||||||
for (int row = 1; row < table.getRowCount(); row++) {
|
for (int row = 1; row < table.getRowCount(); row++) {
|
||||||
final AccountInfo i = getRowItem(row);
|
final AccountInfo i = getRowItem(row);
|
||||||
if (i != null && ((CheckBox) table.getWidget(row, 1)).getValue()) {
|
if (i != null && ((CheckBox) table.getWidget(row, 1)).getValue()) {
|
||||||
ids.add(i._account_id());
|
ids.add(i._accountId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ids.isEmpty()) {
|
if (!ids.isEmpty()) {
|
||||||
@@ -258,7 +258,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
|
|||||||
public void onSuccess(final VoidResult result) {
|
public void onSuccess(final VoidResult result) {
|
||||||
for (int row = 1; row < table.getRowCount();) {
|
for (int row = 1; row < table.getRowCount();) {
|
||||||
final AccountInfo i = getRowItem(row);
|
final AccountInfo i = getRowItem(row);
|
||||||
if (i != null && ids.contains(i._account_id())) {
|
if (i != null && ids.contains(i._accountId())) {
|
||||||
table.removeRow(row);
|
table.removeRow(row);
|
||||||
} else {
|
} else {
|
||||||
row++;
|
row++;
|
||||||
@@ -296,7 +296,7 @@ public class AccountGroupMembersScreen extends AccountGroupScreen {
|
|||||||
return cmp;
|
return cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
return a._account_id() - b._account_id();
|
return a._accountId() - b._accountId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String nullToEmpty(String str) {
|
public String nullToEmpty(String str) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class CreateChangeAction {
|
|||||||
public void onSuccess(ChangeInfo result) {
|
public void onSuccess(ChangeInfo result) {
|
||||||
sent = true;
|
sent = true;
|
||||||
hide();
|
hide();
|
||||||
Gerrit.display(PageLinks.toChange(result.legacy_id()));
|
Gerrit.display(PageLinks.toChange(result.legacyId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class EditConfigAction {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(ChangeInfo result) {
|
public void onSuccess(ChangeInfo result) {
|
||||||
Gerrit.display(Dispatcher.toEditScreen(
|
Gerrit.display(Dispatcher.toEditScreen(
|
||||||
new PatchSet.Id(result.legacy_id(), 1), "project.config"));
|
new PatchSet.Id(result.legacyId(), 1), "project.config"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -485,8 +485,8 @@ public class ProjectBranchesScreen extends ProjectScreen {
|
|||||||
actionsPanel.add(new Anchor(c.getLinkName(), false,
|
actionsPanel.add(new Anchor(c.getLinkName(), false,
|
||||||
c.toBranch(new Branch.NameKey(getProjectKey(), k.ref()))));
|
c.toBranch(new Branch.NameKey(getProjectKey(), k.ref()))));
|
||||||
}
|
}
|
||||||
if (k.web_links() != null) {
|
if (k.webLinks() != null) {
|
||||||
for (WebLinkInfo webLink : Natives.asList(k.web_links())) {
|
for (WebLinkInfo webLink : Natives.asList(k.webLinks())) {
|
||||||
actionsPanel.add(webLink.toAnchor());
|
actionsPanel.add(webLink.toAnchor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ public class ProjectInfoScreen extends ProjectScreen {
|
|||||||
if (box.getValue(i).startsWith(InheritableBoolean.INHERIT.name())) {
|
if (box.getValue(i).startsWith(InheritableBoolean.INHERIT.name())) {
|
||||||
inheritedIndex = i;
|
inheritedIndex = i;
|
||||||
}
|
}
|
||||||
if (box.getValue(i).startsWith(inheritedBoolean.configured_value().name())) {
|
if (box.getValue(i).startsWith(inheritedBoolean.configuredValue().name())) {
|
||||||
box.setSelectedIndex(i);
|
box.setSelectedIndex(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,7 +322,7 @@ public class ProjectInfoScreen extends ProjectScreen {
|
|||||||
box.removeItem(inheritedIndex);
|
box.removeItem(inheritedIndex);
|
||||||
} else {
|
} else {
|
||||||
box.setItemText(inheritedIndex, InheritableBoolean.INHERIT.name() + " ("
|
box.setItemText(inheritedIndex, InheritableBoolean.INHERIT.name() + " ("
|
||||||
+ inheritedBoolean.inherited_value() + ")");
|
+ inheritedBoolean.inheritedValue() + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -341,20 +341,20 @@ public class ProjectInfoScreen extends ProjectScreen {
|
|||||||
|
|
||||||
void display(ConfigInfo result) {
|
void display(ConfigInfo result) {
|
||||||
descTxt.setText(result.description());
|
descTxt.setText(result.description());
|
||||||
setBool(contributorAgreements, result.use_contributor_agreements());
|
setBool(contributorAgreements, result.useContributorAgreements());
|
||||||
setBool(signedOffBy, result.use_signed_off_by());
|
setBool(signedOffBy, result.useSignedOffBy());
|
||||||
setBool(contentMerge, result.use_content_merge());
|
setBool(contentMerge, result.useContentMerge());
|
||||||
setBool(newChangeForAllNotInTarget, result.create_new_change_for_all_not_in_target());
|
setBool(newChangeForAllNotInTarget, result.createNewChangeForAllNotInTarget());
|
||||||
setBool(requireChangeID, result.require_change_id());
|
setBool(requireChangeID, result.requireChangeId());
|
||||||
setSubmitType(result.submit_type());
|
setSubmitType(result.submitType());
|
||||||
setState(result.state());
|
setState(result.state());
|
||||||
maxObjectSizeLimit.setText(result.max_object_size_limit().configured_value());
|
maxObjectSizeLimit.setText(result.maxObjectSizeLimit().configuredValue());
|
||||||
if (result.max_object_size_limit().inherited_value() != null) {
|
if (result.maxObjectSizeLimit().inheritedValue() != null) {
|
||||||
effectiveMaxObjectSizeLimit.setVisible(true);
|
effectiveMaxObjectSizeLimit.setVisible(true);
|
||||||
effectiveMaxObjectSizeLimit.setText(
|
effectiveMaxObjectSizeLimit.setText(
|
||||||
Util.M.effectiveMaxObjectSizeLimit(result.max_object_size_limit().value()));
|
Util.M.effectiveMaxObjectSizeLimit(result.maxObjectSizeLimit().value()));
|
||||||
effectiveMaxObjectSizeLimit.setTitle(
|
effectiveMaxObjectSizeLimit.setTitle(
|
||||||
Util.M.globalMaxObjectSizeLimit(result.max_object_size_limit().inherited_value()));
|
Util.M.globalMaxObjectSizeLimit(result.maxObjectSizeLimit().inheritedValue()));
|
||||||
} else {
|
} else {
|
||||||
effectiveMaxObjectSizeLimit.setVisible(false);
|
effectiveMaxObjectSizeLimit.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ public class ProjectListScreen extends Screen {
|
|||||||
|
|
||||||
private void addWebLinks(int row, ProjectInfo k) {
|
private void addWebLinks(int row, ProjectInfo k) {
|
||||||
GitwebLink gitWebLink = Gerrit.getGitwebLink();
|
GitwebLink gitWebLink = Gerrit.getGitwebLink();
|
||||||
List<WebLinkInfo> webLinks = Natives.asList(k.web_links());
|
List<WebLinkInfo> webLinks = Natives.asList(k.webLinks());
|
||||||
if (gitWebLink != null || (webLinks != null && !webLinks.isEmpty())) {
|
if (gitWebLink != null || (webLinks != null && !webLinks.isEmpty())) {
|
||||||
FlowPanel p = new FlowPanel();
|
FlowPanel p = new FlowPanel();
|
||||||
table.setWidget(row, ProjectsTable.C_REPO_BROWSER, p);
|
table.setWidget(row, ProjectsTable.C_REPO_BROWSER, p);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class ChangeGlue {
|
|||||||
ChangeInfo change,
|
ChangeInfo change,
|
||||||
ActionInfo action,
|
ActionInfo action,
|
||||||
ActionButton button) {
|
ActionButton button) {
|
||||||
RestApi api = ChangeApi.change(change.legacy_id().get()).view(action.id());
|
RestApi api = ChangeApi.change(change.legacyId().get()).view(action.id());
|
||||||
JavaScriptObject f = get(action.id());
|
JavaScriptObject f = get(action.id());
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
ActionContext c = ActionContext.create(api);
|
ActionContext c = ActionContext.create(api);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
|||||||
|
|
||||||
class DefaultActions {
|
class DefaultActions {
|
||||||
static void invoke(ChangeInfo change, ActionInfo action, RestApi api) {
|
static void invoke(ChangeInfo change, ActionInfo action, RestApi api) {
|
||||||
invoke(action, api, callback(PageLinks.toChange(change.legacy_id())));
|
invoke(action, api, callback(PageLinks.toChange(change.legacyId())));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void invoke(Project.NameKey project, ActionInfo action, RestApi api) {
|
static void invoke(Project.NameKey project, ActionInfo action, RestApi api) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class EditGlue {
|
|||||||
ActionInfo action,
|
ActionInfo action,
|
||||||
ActionButton button) {
|
ActionButton button) {
|
||||||
RestApi api = ChangeApi.edit(
|
RestApi api = ChangeApi.edit(
|
||||||
change.legacy_id().get())
|
change.legacyId().get())
|
||||||
.view(action.id());
|
.view(action.id());
|
||||||
|
|
||||||
JavaScriptObject f = get(action.id());
|
JavaScriptObject f = get(action.id());
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class RevisionGlue {
|
|||||||
ActionInfo action,
|
ActionInfo action,
|
||||||
ActionButton button) {
|
ActionButton button) {
|
||||||
RestApi api = ChangeApi.revision(
|
RestApi api = ChangeApi.revision(
|
||||||
change.legacy_id().get(),
|
change.legacyId().get(),
|
||||||
revision.name())
|
revision.name())
|
||||||
.view(action.id());
|
.view(action.id());
|
||||||
|
|
||||||
|
|||||||
@@ -78,17 +78,17 @@ class Actions extends Composite {
|
|||||||
boolean hasUser = Gerrit.isSignedIn();
|
boolean hasUser = Gerrit.isSignedIn();
|
||||||
RevisionInfo revInfo = info.revision(revision);
|
RevisionInfo revInfo = info.revision(revision);
|
||||||
CommitInfo commit = revInfo.commit();
|
CommitInfo commit = revInfo.commit();
|
||||||
changeId = info.legacy_id();
|
changeId = info.legacyId();
|
||||||
project = info.project();
|
project = info.project();
|
||||||
subject = commit.subject();
|
subject = commit.subject();
|
||||||
message = commit.message();
|
message = commit.message();
|
||||||
branch = info.branch();
|
branch = info.branch();
|
||||||
key = info.change_id();
|
key = info.changeId();
|
||||||
changeInfo = info;
|
changeInfo = info;
|
||||||
|
|
||||||
initChangeActions(info, hasUser);
|
initChangeActions(info, hasUser);
|
||||||
|
|
||||||
NativeMap<ActionInfo> actionMap = revInfo.has_actions()
|
NativeMap<ActionInfo> actionMap = revInfo.hasActions()
|
||||||
? revInfo.actions()
|
? revInfo.actions()
|
||||||
: NativeMap.<ActionInfo> create();
|
: NativeMap.<ActionInfo> create();
|
||||||
actionMap.copyKeysIntoChildren("id");
|
actionMap.copyKeysIntoChildren("id");
|
||||||
@@ -96,7 +96,7 @@ class Actions extends Composite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initChangeActions(ChangeInfo info, boolean hasUser) {
|
private void initChangeActions(ChangeInfo info, boolean hasUser) {
|
||||||
NativeMap<ActionInfo> actions = info.has_actions()
|
NativeMap<ActionInfo> actions = info.hasActions()
|
||||||
? info.actions()
|
? info.actions()
|
||||||
: NativeMap.<ActionInfo> create();
|
: NativeMap.<ActionInfo> create();
|
||||||
actions.copyKeysIntoChildren("id");
|
actions.copyKeysIntoChildren("id");
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ public class ChangeScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initReplyButton(ChangeInfo info, String revision) {
|
private void initReplyButton(ChangeInfo info, String revision) {
|
||||||
if (!info.revision(revision).is_edit()) {
|
if (!info.revision(revision).isEdit()) {
|
||||||
reply.setTitle(Gerrit.getConfig().getReplyTitle());
|
reply.setTitle(Gerrit.getConfig().getReplyTitle());
|
||||||
reply.setHTML(new SafeHtmlBuilder()
|
reply.setHTML(new SafeHtmlBuilder()
|
||||||
.openDiv()
|
.openDiv()
|
||||||
@@ -310,7 +310,7 @@ public class ChangeScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void gotoSibling(final int offset) {
|
private void gotoSibling(final int offset) {
|
||||||
if (offset > 0 && changeInfo.current_revision().equals(revision)) {
|
if (offset > 0 && changeInfo.currentRevision().equals(revision)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ public class ChangeScreen extends Screen {
|
|||||||
if (revision.equals(revisions.get(i).name())) {
|
if (revision.equals(revisions.get(i).name())) {
|
||||||
if (0 <= i + offset && i + offset < revisions.length()) {
|
if (0 <= i + offset && i + offset < revisions.length()) {
|
||||||
Gerrit.display(PageLinks.toChange(
|
Gerrit.display(PageLinks.toChange(
|
||||||
new PatchSet.Id(changeInfo.legacy_id(),
|
new PatchSet.Id(changeInfo.legacyId(),
|
||||||
revisions.get(i + offset)._number())));
|
revisions.get(i + offset)._number())));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -336,7 +336,7 @@ public class ChangeScreen extends Screen {
|
|||||||
private void initIncludedInAction(ChangeInfo info) {
|
private void initIncludedInAction(ChangeInfo info) {
|
||||||
if (info.status() == Status.MERGED) {
|
if (info.status() == Status.MERGED) {
|
||||||
includedInAction = new IncludedInAction(
|
includedInAction = new IncludedInAction(
|
||||||
info.legacy_id(),
|
info.legacyId(),
|
||||||
style, headerLine, includedIn);
|
style, headerLine, includedIn);
|
||||||
includedIn.setVisible(true);
|
includedIn.setVisible(true);
|
||||||
}
|
}
|
||||||
@@ -344,7 +344,7 @@ public class ChangeScreen extends Screen {
|
|||||||
|
|
||||||
private void initChangeAction(ChangeInfo info) {
|
private void initChangeAction(ChangeInfo info) {
|
||||||
if (info.status() == Status.DRAFT) {
|
if (info.status() == Status.DRAFT) {
|
||||||
NativeMap<ActionInfo> actions = info.has_actions()
|
NativeMap<ActionInfo> actions = info.hasActions()
|
||||||
? info.actions()
|
? info.actions()
|
||||||
: NativeMap.<ActionInfo> create();
|
: NativeMap.<ActionInfo> create();
|
||||||
actions.copyKeysIntoChildren("id");
|
actions.copyKeysIntoChildren("id");
|
||||||
@@ -358,9 +358,9 @@ public class ChangeScreen extends Screen {
|
|||||||
private void initRevisionsAction(ChangeInfo info, String revision,
|
private void initRevisionsAction(ChangeInfo info, String revision,
|
||||||
NativeMap<ActionInfo> actions) {
|
NativeMap<ActionInfo> actions) {
|
||||||
int currentPatchSet;
|
int currentPatchSet;
|
||||||
if (info.current_revision() != null
|
if (info.currentRevision() != null
|
||||||
&& info.revisions().containsKey(info.current_revision())) {
|
&& info.revisions().containsKey(info.currentRevision())) {
|
||||||
currentPatchSet = info.revision(info.current_revision())._number();
|
currentPatchSet = info.revision(info.currentRevision())._number();
|
||||||
} else {
|
} else {
|
||||||
JsArray<RevisionInfo> revList = info.revisions().values();
|
JsArray<RevisionInfo> revList = info.revisions().values();
|
||||||
RevisionInfo.sortRevisionInfoByNumber(revList);
|
RevisionInfo.sortRevisionInfoByNumber(revList);
|
||||||
@@ -379,7 +379,7 @@ public class ChangeScreen extends Screen {
|
|||||||
patchSetsText.setInnerText(Resources.M.patchSets(
|
patchSetsText.setInnerText(Resources.M.patchSets(
|
||||||
currentlyViewedPatchSet, currentPatchSet));
|
currentlyViewedPatchSet, currentPatchSet));
|
||||||
patchSetsAction = new PatchSetsAction(
|
patchSetsAction = new PatchSetsAction(
|
||||||
info.legacy_id(), revision,
|
info.legacyId(), revision,
|
||||||
style, headerLine, patchSets);
|
style, headerLine, patchSets);
|
||||||
|
|
||||||
RevisionInfo revInfo = info.revision(revision);
|
RevisionInfo revInfo = info.revision(revision);
|
||||||
@@ -402,20 +402,20 @@ public class ChangeScreen extends Screen {
|
|||||||
|
|
||||||
private void initProjectLinks(final ChangeInfo info) {
|
private void initProjectLinks(final ChangeInfo info) {
|
||||||
projectSettingsLink.setHref(
|
projectSettingsLink.setHref(
|
||||||
"#" + PageLinks.toProject(info.project_name_key()));
|
"#" + PageLinks.toProject(info.projectNameKey()));
|
||||||
projectSettings.addDomHandler(new ClickHandler() {
|
projectSettings.addDomHandler(new ClickHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
if (Hyperlink.impl.handleAsClick((Event) event.getNativeEvent())) {
|
if (Hyperlink.impl.handleAsClick((Event) event.getNativeEvent())) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
Gerrit.display(PageLinks.toProject(info.project_name_key()));
|
Gerrit.display(PageLinks.toProject(info.projectNameKey()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, ClickEvent.getType());
|
}, ClickEvent.getType());
|
||||||
projectDashboard.setText(info.project());
|
projectDashboard.setText(info.project());
|
||||||
projectDashboard.setTargetHistoryToken(
|
projectDashboard.setTargetHistoryToken(
|
||||||
PageLinks.toProjectDefaultDashboard(info.project_name_key()));
|
PageLinks.toProjectDefaultDashboard(info.projectNameKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initBranchLink(ChangeInfo info) {
|
private void initBranchLink(ChangeInfo info) {
|
||||||
@@ -423,7 +423,7 @@ public class ChangeScreen extends Screen {
|
|||||||
branchLink.setTargetHistoryToken(
|
branchLink.setTargetHistoryToken(
|
||||||
PageLinks.toChangeQuery(
|
PageLinks.toChangeQuery(
|
||||||
BranchLink.query(
|
BranchLink.query(
|
||||||
info.project_name_key(),
|
info.projectNameKey(),
|
||||||
info.status(),
|
info.status(),
|
||||||
info.branch(),
|
info.branch(),
|
||||||
null)));
|
null)));
|
||||||
@@ -453,7 +453,7 @@ public class ChangeScreen extends Screen {
|
|||||||
reviewMode.setVisible(false);
|
reviewMode.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rev.is_edit()) {
|
if (rev.isEdit()) {
|
||||||
if (info.hasEditBasedOnCurrentPatchSet()) {
|
if (info.hasEditBasedOnCurrentPatchSet()) {
|
||||||
publishEdit.setVisible(true);
|
publishEdit.setVisible(true);
|
||||||
} else {
|
} else {
|
||||||
@@ -465,11 +465,11 @@ public class ChangeScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isEditModeEnabled(ChangeInfo info, RevisionInfo rev) {
|
private boolean isEditModeEnabled(ChangeInfo info, RevisionInfo rev) {
|
||||||
if (rev.is_edit()) {
|
if (rev.isEdit()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (edit == null) {
|
if (edit == null) {
|
||||||
return revision.equals(info.current_revision());
|
return revision.equals(info.currentRevision());
|
||||||
}
|
}
|
||||||
return rev._number() == RevisionInfo.findEditParent(
|
return rev._number() == RevisionInfo.findEditParent(
|
||||||
info.revisions().values());
|
info.revisions().values());
|
||||||
@@ -781,9 +781,9 @@ public class ChangeScreen extends Screen {
|
|||||||
private void loadConfigInfo(final ChangeInfo info, final String base) {
|
private void loadConfigInfo(final ChangeInfo info, final String base) {
|
||||||
info.revisions().copyKeysIntoChildren("name");
|
info.revisions().copyKeysIntoChildren("name");
|
||||||
if (edit != null) {
|
if (edit != null) {
|
||||||
edit.set_name(edit.commit().commit());
|
edit.setName(edit.commit().commit());
|
||||||
info.set_edit(edit);
|
info.setEdit(edit);
|
||||||
if (edit.has_files()) {
|
if (edit.hasFiles()) {
|
||||||
edit.files().copyKeysIntoChildren("path");
|
edit.files().copyKeysIntoChildren("path");
|
||||||
}
|
}
|
||||||
info.revisions().put(edit.name(), RevisionInfo.fromEdit(edit));
|
info.revisions().put(edit.name(), RevisionInfo.fromEdit(edit));
|
||||||
@@ -801,14 +801,14 @@ public class ChangeScreen extends Screen {
|
|||||||
if (revision == null) {
|
if (revision == null) {
|
||||||
RevisionInfo.sortRevisionInfoByNumber(list);
|
RevisionInfo.sortRevisionInfoByNumber(list);
|
||||||
RevisionInfo rev = list.get(list.length() - 1);
|
RevisionInfo rev = list.get(list.length() - 1);
|
||||||
if (rev.is_edit()) {
|
if (rev.isEdit()) {
|
||||||
info.set_current_revision(rev.name());
|
info.setCurrentRevision(rev.name());
|
||||||
}
|
}
|
||||||
} else if (revision.equals("edit") || revision.equals("0")) {
|
} else if (revision.equals("edit") || revision.equals("0")) {
|
||||||
for (int i = 0; i < list.length(); i++) {
|
for (int i = 0; i < list.length(); i++) {
|
||||||
RevisionInfo r = list.get(i);
|
RevisionInfo r = list.get(i);
|
||||||
if (r.is_edit()) {
|
if (r.isEdit()) {
|
||||||
info.set_current_revision(r.name());
|
info.setCurrentRevision(r.name());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -819,7 +819,7 @@ public class ChangeScreen extends Screen {
|
|||||||
|
|
||||||
CallbackGroup group = new CallbackGroup();
|
CallbackGroup group = new CallbackGroup();
|
||||||
Timestamp lastReply = myLastReply(info);
|
Timestamp lastReply = myLastReply(info);
|
||||||
if (rev.is_edit()) {
|
if (rev.isEdit()) {
|
||||||
loadFileList(b, rev, lastReply, group, null, null);
|
loadFileList(b, rev, lastReply, group, null, null);
|
||||||
} else {
|
} else {
|
||||||
loadDiff(b, rev, lastReply, group);
|
loadDiff(b, rev, lastReply, group);
|
||||||
@@ -833,7 +833,7 @@ public class ChangeScreen extends Screen {
|
|||||||
|
|
||||||
RevisionInfoCache.add(changeId, rev);
|
RevisionInfoCache.add(changeId, rev);
|
||||||
ConfigInfoCache.add(info);
|
ConfigInfoCache.add(info);
|
||||||
ConfigInfoCache.get(info.project_name_key(),
|
ConfigInfoCache.get(info.projectNameKey(),
|
||||||
group.addFinal(new ScreenLoadCallback<ConfigInfoCache.Entry>(this) {
|
group.addFinal(new ScreenLoadCallback<ConfigInfoCache.Entry>(this) {
|
||||||
@Override
|
@Override
|
||||||
protected void preDisplay(Entry result) {
|
protected void preDisplay(Entry result) {
|
||||||
@@ -848,10 +848,10 @@ public class ChangeScreen extends Screen {
|
|||||||
|
|
||||||
static Timestamp myLastReply(ChangeInfo info) {
|
static Timestamp myLastReply(ChangeInfo info) {
|
||||||
if (Gerrit.isSignedIn() && info.messages() != null) {
|
if (Gerrit.isSignedIn() && info.messages() != null) {
|
||||||
int self = Gerrit.getUserAccountInfo()._account_id();
|
int self = Gerrit.getUserAccountInfo()._accountId();
|
||||||
for (int i = info.messages().length() - 1; i >= 0; i--) {
|
for (int i = info.messages().length() - 1; i >= 0; i--) {
|
||||||
MessageInfo m = info.messages().get(i);
|
MessageInfo m = info.messages().get(i);
|
||||||
if (m.author() != null && m.author()._account_id() == self) {
|
if (m.author() != null && m.author()._accountId() == self) {
|
||||||
return m.date();
|
return m.date();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -938,7 +938,7 @@ public class ChangeScreen extends Screen {
|
|||||||
JsArray<CommentInfo> thisRevision = JsArray.createArray().cast();
|
JsArray<CommentInfo> thisRevision = JsArray.createArray().cast();
|
||||||
for (int i = 0; i < allRevisions.length(); i++) {
|
for (int i = 0; i < allRevisions.length(); i++) {
|
||||||
CommentInfo c = allRevisions.get(i);
|
CommentInfo c = allRevisions.get(i);
|
||||||
if (c.patch_set() == id) {
|
if (c.patchSet() == id) {
|
||||||
thisRevision.push(c);
|
thisRevision.push(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -971,7 +971,7 @@ public class ChangeScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadCommit(final RevisionInfo rev, CallbackGroup group) {
|
private void loadCommit(final RevisionInfo rev, CallbackGroup group) {
|
||||||
if (rev.is_edit()) {
|
if (rev.isEdit()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -979,7 +979,7 @@ public class ChangeScreen extends Screen {
|
|||||||
group.add(new AsyncCallback<CommitInfo>() {
|
group.add(new AsyncCallback<CommitInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(CommitInfo info) {
|
public void onSuccess(CommitInfo info) {
|
||||||
rev.set_commit(info);
|
rev.setCommit(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1019,7 +1019,7 @@ public class ChangeScreen extends Screen {
|
|||||||
|
|
||||||
private RevisionInfo resolveRevisionToDisplay(ChangeInfo info) {
|
private RevisionInfo resolveRevisionToDisplay(ChangeInfo info) {
|
||||||
RevisionInfo rev = resolveRevisionOrPatchSetId(info, revision,
|
RevisionInfo rev = resolveRevisionOrPatchSetId(info, revision,
|
||||||
info.current_revision());
|
info.currentRevision());
|
||||||
if (rev != null) {
|
if (rev != null) {
|
||||||
revision = rev.name();
|
revision = rev.name();
|
||||||
return rev;
|
return rev;
|
||||||
@@ -1036,7 +1036,7 @@ public class ChangeScreen extends Screen {
|
|||||||
return rev;
|
return rev;
|
||||||
} else {
|
} else {
|
||||||
new ErrorDialog(
|
new ErrorDialog(
|
||||||
Resources.M.changeWithNoRevisions(info.legacy_id().get())).center();
|
Resources.M.changeWithNoRevisions(info.legacyId().get())).center();
|
||||||
throw new IllegalStateException("no revision, cannot proceed");
|
throw new IllegalStateException("no revision, cannot proceed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1116,7 +1116,7 @@ public class ChangeScreen extends Screen {
|
|||||||
|
|
||||||
star.setValue(info.starred());
|
star.setValue(info.starred());
|
||||||
permalink.setHref(ChangeLink.permalink(changeId));
|
permalink.setHref(ChangeLink.permalink(changeId));
|
||||||
permalink.setText(String.valueOf(info.legacy_id()));
|
permalink.setText(String.valueOf(info.legacyId()));
|
||||||
topic.set(info, revision);
|
topic.set(info, revision);
|
||||||
commit.set(commentLinkProcessor, info, revision);
|
commit.set(commentLinkProcessor, info, revision);
|
||||||
related.set(info, revision);
|
related.set(info, revision);
|
||||||
@@ -1128,7 +1128,7 @@ public class ChangeScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(Util.M.changeScreenTitleId(info.id_abbreviated()));
|
sb.append(Util.M.changeScreenTitleId(info.idAbbreviated()));
|
||||||
if (info.subject() != null) {
|
if (info.subject() != null) {
|
||||||
sb.append(": ");
|
sb.append(": ");
|
||||||
sb.append(info.subject());
|
sb.append(info.subject());
|
||||||
@@ -1138,8 +1138,8 @@ public class ChangeScreen extends Screen {
|
|||||||
// Although this is related to the revision, we can process it early to
|
// Although this is related to the revision, we can process it early to
|
||||||
// render it faster.
|
// render it faster.
|
||||||
if (!info.status().isOpen()
|
if (!info.status().isOpen()
|
||||||
|| !revision.equals(info.current_revision())
|
|| !revision.equals(info.currentRevision())
|
||||||
|| info.revision(revision).is_edit()) {
|
|| info.revision(revision).isEdit()) {
|
||||||
setVisible(strategy, false);
|
setVisible(strategy, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1151,10 +1151,10 @@ public class ChangeScreen extends Screen {
|
|||||||
actions.reloadRevisionActions(emptyMap);
|
actions.reloadRevisionActions(emptyMap);
|
||||||
|
|
||||||
RevisionInfo revisionInfo = info.revision(revision);
|
RevisionInfo revisionInfo = info.revision(revision);
|
||||||
boolean current = revision.equals(info.current_revision())
|
boolean current = revision.equals(info.currentRevision())
|
||||||
&& !revisionInfo.is_edit();
|
&& !revisionInfo.isEdit();
|
||||||
|
|
||||||
if (revisionInfo.is_edit()) {
|
if (revisionInfo.isEdit()) {
|
||||||
statusText.setInnerText(Util.C.changeEdit());
|
statusText.setInnerText(Util.C.changeEdit());
|
||||||
} else if (!current) {
|
} else if (!current) {
|
||||||
statusText.setInnerText(Util.C.notCurrent());
|
statusText.setInnerText(Util.C.notCurrent());
|
||||||
@@ -1203,7 +1203,7 @@ public class ChangeScreen extends Screen {
|
|||||||
? info.owner().name()
|
? info.owner().name()
|
||||||
: info.owner().email() != null
|
: info.owner().email() != null
|
||||||
? info.owner().email()
|
? info.owner().email()
|
||||||
: String.valueOf(info.owner()._account_id()), Change.Status.NEW));
|
: String.valueOf(info.owner()._accountId()), Change.Status.NEW));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderSubmitType(String action) {
|
private void renderSubmitType(String action) {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class CherryPickAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSend() {
|
public void onSend() {
|
||||||
ChangeApi.cherrypick(info.legacy_id().get(), revision,
|
ChangeApi.cherrypick(info.legacyId().get(), revision,
|
||||||
getDestinationBranch(),
|
getDestinationBranch(),
|
||||||
getMessageText(),
|
getMessageText(),
|
||||||
new GerritCallback<ChangeInfo>() {
|
new GerritCallback<ChangeInfo>() {
|
||||||
@@ -55,7 +55,7 @@ class CherryPickAction {
|
|||||||
public void onSuccess(ChangeInfo result) {
|
public void onSuccess(ChangeInfo result) {
|
||||||
sent = true;
|
sent = true;
|
||||||
hide();
|
hide();
|
||||||
Gerrit.display(PageLinks.toChange(result.legacy_id()));
|
Gerrit.display(PageLinks.toChange(result.legacyId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ class CommitBox extends Composite {
|
|||||||
CommitInfo commit = revInfo.commit();
|
CommitInfo commit = revInfo.commit();
|
||||||
|
|
||||||
commitName.setText(revision);
|
commitName.setText(revision);
|
||||||
idText.setText("Change-Id: " + change.change_id());
|
idText.setText("Change-Id: " + change.changeId());
|
||||||
idText.setPreviewText(change.change_id());
|
idText.setPreviewText(change.changeId());
|
||||||
|
|
||||||
formatLink(commit.author(), authorPanel, authorNameEmail, authorDate,
|
formatLink(commit.author(), authorPanel, authorNameEmail, authorDate,
|
||||||
change);
|
change);
|
||||||
@@ -141,7 +141,7 @@ class CommitBox extends Composite {
|
|||||||
gw.getLinkName());
|
gw.getLinkName());
|
||||||
}
|
}
|
||||||
|
|
||||||
JsArray<WebLinkInfo> links = revInfo.commit().web_links();
|
JsArray<WebLinkInfo> links = revInfo.commit().webLinks();
|
||||||
if (links != null) {
|
if (links != null) {
|
||||||
for (WebLinkInfo link : Natives.asList(links)) {
|
for (WebLinkInfo link : Natives.asList(links)) {
|
||||||
webLinkPanel.add(link.toAnchor());
|
webLinkPanel.add(link.toAnchor());
|
||||||
@@ -191,7 +191,7 @@ class CommitBox extends Composite {
|
|||||||
a.setStyleName(style.parentWebLink());
|
a.setStyleName(style.parentWebLink());
|
||||||
panel.add(a);
|
panel.add(a);
|
||||||
}
|
}
|
||||||
JsArray<WebLinkInfo> links = c.web_links();
|
JsArray<WebLinkInfo> links = c.webLinks();
|
||||||
if (links != null) {
|
if (links != null) {
|
||||||
for (WebLinkInfo link : Natives.asList(links)) {
|
for (WebLinkInfo link : Natives.asList(links)) {
|
||||||
panel.add(link.toAnchor());
|
panel.add(link.toAnchor());
|
||||||
@@ -212,7 +212,7 @@ class CommitBox extends Composite {
|
|||||||
// only try to fetch the avatar image for author and committer if an avatar
|
// only try to fetch the avatar image for author and committer if an avatar
|
||||||
// plugin is installed, if the change owner has no avatar info assume that
|
// plugin is installed, if the change owner has no avatar info assume that
|
||||||
// no avatar plugin is installed
|
// no avatar plugin is installed
|
||||||
if (change.owner().has_avatar_info()) {
|
if (change.owner().hasAvatarInfo()) {
|
||||||
AvatarImage avatar;
|
AvatarImage avatar;
|
||||||
if (change.owner().email().equals(person.email())) {
|
if (change.owner().email().equals(person.email())) {
|
||||||
avatar = new AvatarImage(change.owner());
|
avatar = new AvatarImage(change.owner());
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class DownloadAction extends RightSidePopdownAction {
|
|||||||
Widget downloadButton) {
|
Widget downloadButton) {
|
||||||
super(style, relativeTo, downloadButton);
|
super(style, relativeTo, downloadButton);
|
||||||
this.downloadBox = new DownloadBox(info, revision,
|
this.downloadBox = new DownloadBox(info, revision,
|
||||||
new PatchSet.Id(info.legacy_id(),
|
new PatchSet.Id(info.legacyId(),
|
||||||
info.revision(revision)._number()));
|
info.revision(revision)._number()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class DownloadBox extends VerticalPanel {
|
|||||||
protected void onLoad() {
|
protected void onLoad() {
|
||||||
if (fetch == null) {
|
if (fetch == null) {
|
||||||
if (psId.get() == 0) {
|
if (psId.get() == 0) {
|
||||||
ChangeApi.editWithCommands(change.legacy_id().get()).get(
|
ChangeApi.editWithCommands(change.legacyId().get()).get(
|
||||||
new AsyncCallback<EditInfo>() {
|
new AsyncCallback<EditInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(EditInfo result) {
|
public void onSuccess(EditInfo result) {
|
||||||
@@ -93,9 +93,9 @@ class DownloadBox extends VerticalPanel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
RestApi call = ChangeApi.detail(change.legacy_id().get());
|
RestApi call = ChangeApi.detail(change.legacyId().get());
|
||||||
ChangeList.addOptions(call, EnumSet.of(
|
ChangeList.addOptions(call, EnumSet.of(
|
||||||
revision.equals(change.current_revision())
|
revision.equals(change.currentRevision())
|
||||||
? ListChangesOption.CURRENT_REVISION
|
? ListChangesOption.CURRENT_REVISION
|
||||||
: ListChangesOption.ALL_REVISIONS,
|
: ListChangesOption.ALL_REVISIONS,
|
||||||
ListChangesOption.DOWNLOAD_COMMANDS));
|
ListChangesOption.DOWNLOAD_COMMANDS));
|
||||||
@@ -268,7 +268,7 @@ class DownloadBox extends VerticalPanel {
|
|||||||
if (scheme != null && scheme != pref.getDownloadUrl()) {
|
if (scheme != null && scheme != pref.getDownloadUrl()) {
|
||||||
pref.setDownloadUrl(scheme);
|
pref.setDownloadUrl(scheme);
|
||||||
PreferenceInput in = PreferenceInput.create();
|
PreferenceInput in = PreferenceInput.create();
|
||||||
in.download_scheme(scheme);
|
in.downloadScheme(scheme);
|
||||||
AccountApi.self().view("preferences")
|
AccountApi.self().view("preferences")
|
||||||
.put(in, new AsyncCallback<JavaScriptObject>() {
|
.put(in, new AsyncCallback<JavaScriptObject>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -303,11 +303,11 @@ class DownloadBox extends VerticalPanel {
|
|||||||
return createObject().cast();
|
return createObject().cast();
|
||||||
}
|
}
|
||||||
|
|
||||||
final void download_scheme(DownloadScheme s) {
|
final void downloadScheme(DownloadScheme s) {
|
||||||
download_scheme0(s.name());
|
downloadScheme0(s.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
private final native void download_scheme0(String n) /*-{
|
private final native void downloadScheme0(String n) /*-{
|
||||||
this.download_scheme = n;
|
this.download_scheme = n;
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
|
|||||||
@@ -516,8 +516,8 @@ public class FileTable extends FlowPanel {
|
|||||||
for (int i = 0; i < list.length(); i++) {
|
for (int i = 0; i < list.length(); i++) {
|
||||||
FileInfo info = list.get(i);
|
FileInfo info = list.get(i);
|
||||||
if (!Patch.COMMIT_MSG.equals(info.path()) && !info.binary()) {
|
if (!Patch.COMMIT_MSG.equals(info.path()) && !info.binary()) {
|
||||||
inserted += info.lines_inserted();
|
inserted += info.linesInserted();
|
||||||
deleted += info.lines_deleted();
|
deleted += info.linesDeleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -657,10 +657,10 @@ public class FileTable extends FlowPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.closeAnchor();
|
sb.closeAnchor();
|
||||||
if (info.old_path() != null) {
|
if (info.oldPath() != null) {
|
||||||
sb.br();
|
sb.br();
|
||||||
sb.openSpan().setStyleName(R.css().renameCopySource())
|
sb.openSpan().setStyleName(R.css().renameCopySource())
|
||||||
.append(info.old_path())
|
.append(info.oldPath())
|
||||||
.closeSpan();
|
.closeSpan();
|
||||||
}
|
}
|
||||||
sb.closeTd();
|
sb.closeTd();
|
||||||
@@ -733,16 +733,16 @@ public class FileTable extends FlowPanel {
|
|||||||
sb.openTd().setStyleName(R.css().deltaColumn1());
|
sb.openTd().setStyleName(R.css().deltaColumn1());
|
||||||
if (!Patch.COMMIT_MSG.equals(info.path()) && !info.binary()) {
|
if (!Patch.COMMIT_MSG.equals(info.path()) && !info.binary()) {
|
||||||
if (showChangeSizeBars) {
|
if (showChangeSizeBars) {
|
||||||
sb.append(info.lines_inserted() + info.lines_deleted());
|
sb.append(info.linesInserted() + info.linesDeleted());
|
||||||
} else if (!ChangeType.DELETED.matches(info.status())) {
|
} else if (!ChangeType.DELETED.matches(info.status())) {
|
||||||
if (ChangeType.ADDED.matches(info.status())) {
|
if (ChangeType.ADDED.matches(info.status())) {
|
||||||
sb.append(info.lines_inserted())
|
sb.append(info.linesInserted())
|
||||||
.append(" lines");
|
.append(" lines");
|
||||||
} else {
|
} else {
|
||||||
sb.append("+")
|
sb.append("+")
|
||||||
.append(info.lines_inserted())
|
.append(info.linesInserted())
|
||||||
.append(", -")
|
.append(", -")
|
||||||
.append(info.lines_deleted());
|
.append(info.linesDeleted());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -753,24 +753,24 @@ public class FileTable extends FlowPanel {
|
|||||||
sb.openTd().setStyleName(R.css().deltaColumn2());
|
sb.openTd().setStyleName(R.css().deltaColumn2());
|
||||||
if (showChangeSizeBars
|
if (showChangeSizeBars
|
||||||
&& !Patch.COMMIT_MSG.equals(info.path()) && !info.binary()
|
&& !Patch.COMMIT_MSG.equals(info.path()) && !info.binary()
|
||||||
&& (info.lines_inserted() != 0 || info.lines_deleted() != 0)) {
|
&& (info.linesInserted() != 0 || info.linesDeleted() != 0)) {
|
||||||
int w = 80;
|
int w = 80;
|
||||||
int t = inserted + deleted;
|
int t = inserted + deleted;
|
||||||
int i = Math.max(5, (int) (((double) w) * info.lines_inserted() / t));
|
int i = Math.max(5, (int) (((double) w) * info.linesInserted() / t));
|
||||||
int d = Math.max(5, (int) (((double) w) * info.lines_deleted() / t));
|
int d = Math.max(5, (int) (((double) w) * info.linesDeleted() / t));
|
||||||
|
|
||||||
sb.setAttribute(
|
sb.setAttribute(
|
||||||
"title",
|
"title",
|
||||||
Util.M.patchTableSize_LongModify(info.lines_inserted(),
|
Util.M.patchTableSize_LongModify(info.linesInserted(),
|
||||||
info.lines_deleted()));
|
info.linesDeleted()));
|
||||||
|
|
||||||
if (0 < info.lines_inserted()) {
|
if (0 < info.linesInserted()) {
|
||||||
sb.openDiv()
|
sb.openDiv()
|
||||||
.setStyleName(R.css().inserted())
|
.setStyleName(R.css().inserted())
|
||||||
.setAttribute("style", "width:" + i + "px")
|
.setAttribute("style", "width:" + i + "px")
|
||||||
.closeDiv();
|
.closeDiv();
|
||||||
}
|
}
|
||||||
if (0 < info.lines_deleted()) {
|
if (0 < info.linesDeleted()) {
|
||||||
sb.openDiv()
|
sb.openDiv()
|
||||||
.setStyleName(R.css().deleted())
|
.setStyleName(R.css().deleted())
|
||||||
.setAttribute("style", "width:" + d + "px")
|
.setAttribute("style", "width:" + d + "px")
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class FollowUpAction extends ActionMessageBox {
|
|||||||
new GerritCallback<ChangeInfo>() {
|
new GerritCallback<ChangeInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ChangeInfo result) {
|
public void onSuccess(ChangeInfo result) {
|
||||||
Gerrit.display(PageLinks.toChange(result.legacy_id()));
|
Gerrit.display(PageLinks.toChange(result.legacyId()));
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -123,8 +123,8 @@ public class Hashtags extends Composite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set(ChangeInfo info) {
|
void set(ChangeInfo info) {
|
||||||
canEdit = info.has_actions() && info.actions().containsKey("hashtags");
|
canEdit = info.hasActions() && info.actions().containsKey("hashtags");
|
||||||
this.changeId = info.legacy_id();
|
this.changeId = info.legacyId();
|
||||||
display(info);
|
display(info);
|
||||||
openForm.setVisible(canEdit);
|
openForm.setVisible(canEdit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class History extends FlowPanel {
|
|||||||
for (CommentInfo c : Natives.asList(map.get(path))) {
|
for (CommentInfo c : Natives.asList(map.get(path))) {
|
||||||
c.path(path);
|
c.path(path);
|
||||||
if (c.author() != null) {
|
if (c.author() != null) {
|
||||||
int authorId = c.author()._account_id();
|
int authorId = c.author()._accountId();
|
||||||
List<CommentInfo> l = byAuthor.get(authorId);
|
List<CommentInfo> l = byAuthor.get(authorId);
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
l = new ArrayList<>();
|
l = new ArrayList<>();
|
||||||
@@ -108,7 +108,7 @@ class History extends FlowPanel {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
int authorId = msg.author()._account_id();
|
int authorId = msg.author()._accountId();
|
||||||
List<CommentInfo> list = byAuthor.get(authorId);
|
List<CommentInfo> list = byAuthor.get(authorId);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class Labels extends Grid {
|
|||||||
|
|
||||||
String val = LabelValue.formatValue(v.shortValue());
|
String val = LabelValue.formatValue(v.shortValue());
|
||||||
html.openSpan();
|
html.openSpan();
|
||||||
html.setAttribute("title", label.value_text(val));
|
html.setAttribute("title", label.valueText(val));
|
||||||
if (v.intValue() == approved) {
|
if (v.intValue() == approved) {
|
||||||
html.setStyleName(style.label_ok());
|
html.setStyleName(style.label_ok());
|
||||||
} else if (v.intValue() == rejected) {
|
} else if (v.intValue() == rejected) {
|
||||||
@@ -172,12 +172,12 @@ class Labels extends Grid {
|
|||||||
|
|
||||||
private static boolean isApproved(LabelInfo label, ApprovalInfo ai) {
|
private static boolean isApproved(LabelInfo label, ApprovalInfo ai) {
|
||||||
return label.approved() != null
|
return label.approved() != null
|
||||||
&& label.approved()._account_id() == ai._account_id();
|
&& label.approved()._accountId() == ai._accountId();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isRejected(LabelInfo label, ApprovalInfo ai) {
|
private static boolean isRejected(LabelInfo label, ApprovalInfo ai) {
|
||||||
return label.rejected() != null
|
return label.rejected() != null
|
||||||
&& label.rejected()._account_id() == ai._account_id();
|
&& label.rejected()._accountId() == ai._accountId();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getStyleForLabel(LabelInfo label) {
|
private String getStyleForLabel(LabelInfo label) {
|
||||||
@@ -234,12 +234,12 @@ class Labels extends Grid {
|
|||||||
} else if (ai.email() != null) {
|
} else if (ai.email() != null) {
|
||||||
name = ai.email();
|
name = ai.email();
|
||||||
} else {
|
} else {
|
||||||
name = Integer.toString(ai._account_id());
|
name = Integer.toString(ai._accountId());
|
||||||
}
|
}
|
||||||
|
|
||||||
String votableCategories = "";
|
String votableCategories = "";
|
||||||
if (votable != null) {
|
if (votable != null) {
|
||||||
Set<String> s = votable.get(ai._account_id()).votableLabels();
|
Set<String> s = votable.get(ai._accountId()).votableLabels();
|
||||||
if (!s.isEmpty()) {
|
if (!s.isEmpty()) {
|
||||||
StringBuilder sb = new StringBuilder(Util.C.votable());
|
StringBuilder sb = new StringBuilder(Util.C.votable());
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
@@ -254,7 +254,7 @@ class Labels extends Grid {
|
|||||||
}
|
}
|
||||||
html.openSpan()
|
html.openSpan()
|
||||||
.setAttribute("role", "listitem")
|
.setAttribute("role", "listitem")
|
||||||
.setAttribute(DATA_ID, ai._account_id())
|
.setAttribute(DATA_ID, ai._accountId())
|
||||||
.setAttribute("title", getTitle(ai, votableCategories))
|
.setAttribute("title", getTitle(ai, votableCategories))
|
||||||
.setStyleName(style.label_user());
|
.setStyleName(style.label_user());
|
||||||
if (img != null) {
|
if (img != null) {
|
||||||
@@ -270,7 +270,7 @@ class Labels extends Grid {
|
|||||||
html.closeSelf();
|
html.closeSelf();
|
||||||
}
|
}
|
||||||
html.append(name);
|
html.append(name);
|
||||||
if (removable.contains(ai._account_id())) {
|
if (removable.contains(ai._accountId())) {
|
||||||
html.openElement("button")
|
html.openElement("button")
|
||||||
.setAttribute("title", Util.M.removeReviewer(name))
|
.setAttribute("title", Util.M.removeReviewer(name))
|
||||||
.setAttribute("onclick", REMOVE + "(event)")
|
.setAttribute("onclick", REMOVE + "(event)")
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ class LineComment extends Composite {
|
|||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
|
||||||
PatchSet.Id ps;
|
PatchSet.Id ps;
|
||||||
if (info.patch_set() != defaultPs.get()) {
|
if (info.patchSet() != defaultPs.get()) {
|
||||||
ps = new PatchSet.Id(defaultPs.getParentKey(), info.patch_set());
|
ps = new PatchSet.Id(defaultPs.getParentKey(), info.patchSet());
|
||||||
psNum.setInnerText(Integer.toString(info.patch_set()));
|
psNum.setInnerText(Integer.toString(info.patchSet()));
|
||||||
} else {
|
} else {
|
||||||
ps = defaultPs;
|
ps = defaultPs;
|
||||||
psLoc.removeFromParent();
|
psLoc.removeFromParent();
|
||||||
@@ -56,7 +56,7 @@ class LineComment extends Composite {
|
|||||||
psNum= null;
|
psNum= null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.has_line()) {
|
if (info.hasLine()) {
|
||||||
fileLoc.removeFromParent();
|
fileLoc.removeFromParent();
|
||||||
fileLoc = null;
|
fileLoc = null;
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class PatchSetsBox extends Composite {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(ChangeInfo result) {
|
public void onSuccess(ChangeInfo result) {
|
||||||
if (edit != null) {
|
if (edit != null) {
|
||||||
edit.set_name(edit.commit().commit());
|
edit.setName(edit.commit().commit());
|
||||||
result.revisions().put(edit.name(), RevisionInfo.fromEdit(edit));
|
result.revisions().put(edit.name(), RevisionInfo.fromEdit(edit));
|
||||||
}
|
}
|
||||||
render(result.revisions());
|
render(result.revisions());
|
||||||
@@ -201,7 +201,7 @@ class PatchSetsBox extends Composite {
|
|||||||
if (r.draft()) {
|
if (r.draft()) {
|
||||||
sb.append(Resources.C.draft()).append(' ');
|
sb.append(Resources.C.draft()).append(' ');
|
||||||
}
|
}
|
||||||
if (r.has_draft_comments()) {
|
if (r.hasDraftComments()) {
|
||||||
sb.openSpan()
|
sb.openSpan()
|
||||||
.addStyleName(style.draft_comment())
|
.addStyleName(style.draft_comment())
|
||||||
.setAttribute("title", Resources.C.draftCommentsTooltip())
|
.setAttribute("title", Resources.C.draftCommentsTooltip())
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ class QuickApprove extends Button implements ClickHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set(ChangeInfo info, String commit, ReplyAction action) {
|
void set(ChangeInfo info, String commit, ReplyAction action) {
|
||||||
if (!info.has_permitted_labels() || !info.status().isOpen()) {
|
if (!info.hasPermittedLabels() || !info.status().isOpen()) {
|
||||||
// Quick approve needs at least one label on an open change.
|
// Quick approve needs at least one label on an open change.
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (info.revision(commit).is_edit() || info.revision(commit).draft()) {
|
if (info.revision(commit).isEdit() || info.revision(commit).draft()) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -58,11 +58,11 @@ class QuickApprove extends Button implements ClickHandler {
|
|||||||
|
|
||||||
int index = info.getMissingLabelIndex();
|
int index = info.getMissingLabelIndex();
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
LabelInfo label = Natives.asList(info.all_labels().values()).get(index);
|
LabelInfo label = Natives.asList(info.allLabels().values()).get(index);
|
||||||
JsArrayString values = info.permitted_values(label.name());
|
JsArrayString values = info.permittedValues(label.name());
|
||||||
String s = values.get(values.length() - 1);
|
String s = values.get(values.length() - 1);
|
||||||
short v = LabelInfo.parseValue(s);
|
short v = LabelInfo.parseValue(s);
|
||||||
if (v > 0 && s.equals(label.max_value())) {
|
if (v > 0 && s.equals(label.maxValue())) {
|
||||||
qName = label.name();
|
qName = label.name();
|
||||||
qValueStr = s;
|
qValueStr = s;
|
||||||
qValue = v;
|
qValue = v;
|
||||||
@@ -70,7 +70,7 @@ class QuickApprove extends Button implements ClickHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qName != null) {
|
if (qName != null) {
|
||||||
changeId = info.legacy_id();
|
changeId = info.legacyId();
|
||||||
revision = commit;
|
revision = commit;
|
||||||
input = ReviewInput.create();
|
input = ReviewInput.create();
|
||||||
input.drafts(DraftHandling.PUBLISH_ALL_REVISIONS);
|
input.drafts(DraftHandling.PUBLISH_ALL_REVISIONS);
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ public class RelatedChanges extends TabPanel {
|
|||||||
setForOpenChange(info, revision);
|
setForOpenChange(info, revision);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangeApi.revision(info.legacy_id().get(), revision).view("related")
|
ChangeApi.revision(info.legacyId().get(), revision).view("related")
|
||||||
.get(new TabCallback<RelatedInfo>(Tab.RELATED_CHANGES, info.project(), revision) {
|
.get(new TabCallback<RelatedInfo>(Tab.RELATED_CHANGES, info.project(), revision) {
|
||||||
@Override
|
@Override
|
||||||
public JsArray<ChangeAndCommit> convert(RelatedInfo result) {
|
public JsArray<ChangeAndCommit> convert(RelatedInfo result) {
|
||||||
@@ -190,8 +190,8 @@ public class RelatedChanges extends TabPanel {
|
|||||||
|
|
||||||
StringBuilder cherryPicksQuery = new StringBuilder();
|
StringBuilder cherryPicksQuery = new StringBuilder();
|
||||||
cherryPicksQuery.append(op("project", info.project()));
|
cherryPicksQuery.append(op("project", info.project()));
|
||||||
cherryPicksQuery.append(" ").append(op("change", info.change_id()));
|
cherryPicksQuery.append(" ").append(op("change", info.changeId()));
|
||||||
cherryPicksQuery.append(" ").append(op("-change", info.legacy_id().get()));
|
cherryPicksQuery.append(" ").append(op("-change", info.legacyId().get()));
|
||||||
cherryPicksQuery.append(" -is:abandoned");
|
cherryPicksQuery.append(" -is:abandoned");
|
||||||
ChangeList.query(cherryPicksQuery.toString(),
|
ChangeList.query(cherryPicksQuery.toString(),
|
||||||
EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT),
|
EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT),
|
||||||
@@ -215,7 +215,7 @@ public class RelatedChanges extends TabPanel {
|
|||||||
StringBuilder conflictsQuery = new StringBuilder();
|
StringBuilder conflictsQuery = new StringBuilder();
|
||||||
conflictsQuery.append("status:open");
|
conflictsQuery.append("status:open");
|
||||||
conflictsQuery.append(" is:mergeable");
|
conflictsQuery.append(" is:mergeable");
|
||||||
conflictsQuery.append(" ").append(op("conflicts", info.legacy_id().get()));
|
conflictsQuery.append(" ").append(op("conflicts", info.legacyId().get()));
|
||||||
ChangeList.query(conflictsQuery.toString(),
|
ChangeList.query(conflictsQuery.toString(),
|
||||||
EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT),
|
EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT),
|
||||||
new TabChangeListCallback(Tab.CONFLICTING_CHANGES, info.project(), revision));
|
new TabChangeListCallback(Tab.CONFLICTING_CHANGES, info.project(), revision));
|
||||||
@@ -323,16 +323,16 @@ public class RelatedChanges extends TabPanel {
|
|||||||
protected JsArray<ChangeAndCommit> convert(ChangeList l) {
|
protected JsArray<ChangeAndCommit> convert(ChangeList l) {
|
||||||
JsArray<ChangeAndCommit> arr = JavaScriptObject.createArray().cast();
|
JsArray<ChangeAndCommit> arr = JavaScriptObject.createArray().cast();
|
||||||
for (ChangeInfo i : Natives.asList(l)) {
|
for (ChangeInfo i : Natives.asList(l)) {
|
||||||
if (i.current_revision() != null && i.revisions().containsKey(i.current_revision())) {
|
if (i.currentRevision() != null && i.revisions().containsKey(i.currentRevision())) {
|
||||||
RevisionInfo currentRevision = i.revision(i.current_revision());
|
RevisionInfo currentRevision = i.revision(i.currentRevision());
|
||||||
ChangeAndCommit c = ChangeAndCommit.create();
|
ChangeAndCommit c = ChangeAndCommit.create();
|
||||||
c.set_id(i.id());
|
c.setId(i.id());
|
||||||
c.set_commit(currentRevision.commit());
|
c.setCommit(currentRevision.commit());
|
||||||
c.set_change_number(i.legacy_id().get());
|
c.setChangeNumber(i.legacyId().get());
|
||||||
c.set_revision_number(currentRevision._number());
|
c.setRevisionNumber(currentRevision._number());
|
||||||
c.set_branch(i.branch());
|
c.setBranch(i.branch());
|
||||||
c.set_project(i.project());
|
c.setProject(i.project());
|
||||||
c.set_submittable(i.submittable() && i.mergeable());
|
c.setSubmittable(i.submittable() && i.mergeable());
|
||||||
arr.push(c);
|
arr.push(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,56 +357,56 @@ public class RelatedChanges extends TabPanel {
|
|||||||
final native String project() /*-{ return this.project }-*/;
|
final native String project() /*-{ return this.project }-*/;
|
||||||
final native boolean submittable() /*-{ return this._submittable ? true : false; }-*/;
|
final native boolean submittable() /*-{ return this._submittable ? true : false; }-*/;
|
||||||
|
|
||||||
final native void set_id(String i)
|
final native void setId(String i)
|
||||||
/*-{ if(i)this.change_id=i; }-*/;
|
/*-{ if(i)this.change_id=i; }-*/;
|
||||||
|
|
||||||
final native void set_commit(CommitInfo c)
|
final native void setCommit(CommitInfo c)
|
||||||
/*-{ if(c)this.commit=c; }-*/;
|
/*-{ if(c)this.commit=c; }-*/;
|
||||||
|
|
||||||
final native void set_branch(String b)
|
final native void setBranch(String b)
|
||||||
/*-{ if(b)this.branch=b; }-*/;
|
/*-{ if(b)this.branch=b; }-*/;
|
||||||
|
|
||||||
final native void set_project(String b)
|
final native void setProject(String b)
|
||||||
/*-{ if(b)this.project=b; }-*/;
|
/*-{ if(b)this.project=b; }-*/;
|
||||||
|
|
||||||
public final Change.Id legacy_id() {
|
public final Change.Id legacyId() {
|
||||||
return has_change_number() ? new Change.Id(_change_number()) : null;
|
return hasChangeNumber() ? new Change.Id(_changeNumber()) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final PatchSet.Id patch_set_id() {
|
public final PatchSet.Id patchSetId() {
|
||||||
return has_change_number() && has_revision_number()
|
return hasChangeNumber() && hasRevisionNumber()
|
||||||
? new PatchSet.Id(legacy_id(), _revision_number())
|
? new PatchSet.Id(legacyId(), _revisionNumber())
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final native boolean has_change_number()
|
public final native boolean hasChangeNumber()
|
||||||
/*-{ return this.hasOwnProperty('_change_number') }-*/;
|
/*-{ return this.hasOwnProperty('_change_number') }-*/;
|
||||||
|
|
||||||
final native boolean has_revision_number()
|
final native boolean hasRevisionNumber()
|
||||||
/*-{ return this.hasOwnProperty('_revision_number') }-*/;
|
/*-{ return this.hasOwnProperty('_revision_number') }-*/;
|
||||||
|
|
||||||
final native boolean has_current_revision_number()
|
final native boolean hasCurrentRevisionNumber()
|
||||||
/*-{ return this.hasOwnProperty('_current_revision_number') }-*/;
|
/*-{ return this.hasOwnProperty('_current_revision_number') }-*/;
|
||||||
|
|
||||||
final native int _change_number()
|
final native int _changeNumber()
|
||||||
/*-{ return this._change_number }-*/;
|
/*-{ return this._change_number }-*/;
|
||||||
|
|
||||||
final native int _revision_number()
|
final native int _revisionNumber()
|
||||||
/*-{ return this._revision_number }-*/;
|
/*-{ return this._revision_number }-*/;
|
||||||
|
|
||||||
final native int _current_revision_number()
|
final native int _currentRevisionNumber()
|
||||||
/*-{ return this._current_revision_number }-*/;
|
/*-{ return this._current_revision_number }-*/;
|
||||||
|
|
||||||
final native void set_change_number(int n)
|
final native void setChangeNumber(int n)
|
||||||
/*-{ this._change_number=n; }-*/;
|
/*-{ this._change_number=n; }-*/;
|
||||||
|
|
||||||
final native void set_revision_number(int n)
|
final native void setRevisionNumber(int n)
|
||||||
/*-{ this._revision_number=n; }-*/;
|
/*-{ this._revision_number=n; }-*/;
|
||||||
|
|
||||||
final native void set_current_revision_number(int n)
|
final native void setCurrentRevisionNumber(int n)
|
||||||
/*-{ this._current_revision_number=n; }-*/;
|
/*-{ this._current_revision_number=n; }-*/;
|
||||||
|
|
||||||
final native void set_submittable(boolean s)
|
final native void setSubmittable(boolean s)
|
||||||
/*-{ this._submittable=s; }-*/;
|
/*-{ this._submittable=s; }-*/;
|
||||||
|
|
||||||
protected ChangeAndCommit() {
|
protected ChangeAndCommit() {
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ class RelatedChangesTab implements IsWidget {
|
|||||||
|
|
||||||
sb.openSpan();
|
sb.openSpan();
|
||||||
GitwebLink gw = Gerrit.getGitwebLink();
|
GitwebLink gw = Gerrit.getGitwebLink();
|
||||||
if (gw != null && (!info.has_change_number() || !info.has_revision_number())) {
|
if (gw != null && (!info.hasChangeNumber() || !info.hasRevisionNumber())) {
|
||||||
sb.setStyleName(RelatedChanges.R.css().gitweb());
|
sb.setStyleName(RelatedChanges.R.css().gitweb());
|
||||||
sb.setAttribute("title", gw.getLinkName());
|
sb.setAttribute("title", gw.getLinkName());
|
||||||
sb.append('\u25CF'); // Unicode 'BLACK CIRCLE'
|
sb.append('\u25CF'); // Unicode 'BLACK CIRCLE'
|
||||||
@@ -310,8 +310,8 @@ class RelatedChangesTab implements IsWidget {
|
|||||||
sb.setStyleName(RelatedChanges.R.css().indirect());
|
sb.setStyleName(RelatedChanges.R.css().indirect());
|
||||||
sb.setAttribute("title", Resources.C.indirectAncestor());
|
sb.setAttribute("title", Resources.C.indirectAncestor());
|
||||||
sb.append('~');
|
sb.append('~');
|
||||||
} else if (info.has_current_revision_number() && info.has_revision_number()
|
} else if (info.hasCurrentRevisionNumber() && info.hasRevisionNumber()
|
||||||
&& info._current_revision_number() != info._revision_number()) {
|
&& info._currentRevisionNumber() != info._revisionNumber()) {
|
||||||
sb.setStyleName(RelatedChanges.R.css().notCurrent());
|
sb.setStyleName(RelatedChanges.R.css().notCurrent());
|
||||||
sb.setAttribute("title", Util.C.notCurrent());
|
sb.setAttribute("title", Util.C.notCurrent());
|
||||||
sb.append('\u25CF'); // Unicode 'BLACK CIRCLE'
|
sb.append('\u25CF'); // Unicode 'BLACK CIRCLE'
|
||||||
@@ -328,8 +328,8 @@ class RelatedChangesTab implements IsWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String url() {
|
private String url() {
|
||||||
if (info.has_change_number() && info.has_revision_number()) {
|
if (info.hasChangeNumber() && info.hasRevisionNumber()) {
|
||||||
PatchSet.Id id = info.patch_set_id();
|
PatchSet.Id id = info.patchSetId();
|
||||||
return "#" + PageLinks.toChange(
|
return "#" + PageLinks.toChange(
|
||||||
id.getParentKey(),
|
id.getParentKey(),
|
||||||
id.getId());
|
id.getId());
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class ReplyAction {
|
|||||||
Widget replyButton,
|
Widget replyButton,
|
||||||
Widget quickApproveButton) {
|
Widget quickApproveButton) {
|
||||||
this.psId = new PatchSet.Id(
|
this.psId = new PatchSet.Id(
|
||||||
info.legacy_id(),
|
info.legacyId(),
|
||||||
info.revisions().get(revision)._number());
|
info.revisions().get(revision)._number());
|
||||||
this.revision = revision;
|
this.revision = revision;
|
||||||
this.hasDraftComments = hasDraftComments;
|
this.hasDraftComments = hasDraftComments;
|
||||||
@@ -63,10 +63,10 @@ class ReplyAction {
|
|||||||
this.replyButton = replyButton;
|
this.replyButton = replyButton;
|
||||||
this.quickApproveButton = quickApproveButton;
|
this.quickApproveButton = quickApproveButton;
|
||||||
|
|
||||||
boolean current = revision.equals(info.current_revision());
|
boolean current = revision.equals(info.currentRevision());
|
||||||
allLabels = info.all_labels();
|
allLabels = info.allLabels();
|
||||||
permittedLabels = current && info.has_permitted_labels()
|
permittedLabels = current && info.hasPermittedLabels()
|
||||||
? info.permitted_labels()
|
? info.permittedLabels()
|
||||||
: NativeMap.<JsArrayString> create();
|
: NativeMap.<JsArrayString> create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ class ReplyBox extends Composite {
|
|||||||
List<LabelAndValues> checkboxes = new ArrayList<>(labels.size());
|
List<LabelAndValues> checkboxes = new ArrayList<>(labels.size());
|
||||||
int row = 1;
|
int row = 1;
|
||||||
for (LabelAndValues lv : labels) {
|
for (LabelAndValues lv : labels) {
|
||||||
if (isCheckBox(lv.info.value_set())) {
|
if (isCheckBox(lv.info.valueSet())) {
|
||||||
checkboxes.add(lv);
|
checkboxes.add(lv);
|
||||||
} else {
|
} else {
|
||||||
renderRadio(row++, columns, lv);
|
renderRadio(row++, columns, lv);
|
||||||
@@ -328,7 +328,7 @@ class ReplyBox extends Composite {
|
|||||||
fmt.setStyleName(row, labelHelpColumn, style.label_help());
|
fmt.setStyleName(row, labelHelpColumn, style.label_help());
|
||||||
|
|
||||||
ApprovalInfo self = Gerrit.isSignedIn()
|
ApprovalInfo self = Gerrit.isSignedIn()
|
||||||
? lv.info.for_user(Gerrit.getUserAccount().getId().get())
|
? lv.info.forUser(Gerrit.getUserAccount().getId().get())
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
final LabelRadioGroup group =
|
final LabelRadioGroup group =
|
||||||
@@ -336,7 +336,7 @@ class ReplyBox extends Composite {
|
|||||||
for (int i = 0; i < columns.size(); i++) {
|
for (int i = 0; i < columns.size(); i++) {
|
||||||
Short v = columns.get(i);
|
Short v = columns.get(i);
|
||||||
if (lv.permitted.contains(v)) {
|
if (lv.permitted.contains(v)) {
|
||||||
String text = lv.info.value_text(LabelValue.formatValue(v));
|
String text = lv.info.valueText(LabelValue.formatValue(v));
|
||||||
LabelRadioButton b = new LabelRadioButton(group, text, v);
|
LabelRadioButton b = new LabelRadioButton(group, text, v);
|
||||||
if ((self != null && v == self.value()) || (self == null && v.equals(dv))) {
|
if ((self != null && v == self.value()) || (self == null && v.equals(dv))) {
|
||||||
b.setValue(true);
|
b.setValue(true);
|
||||||
@@ -352,7 +352,7 @@ class ReplyBox extends Composite {
|
|||||||
|
|
||||||
private void renderCheckBox(int row, LabelAndValues lv) {
|
private void renderCheckBox(int row, LabelAndValues lv) {
|
||||||
ApprovalInfo self = Gerrit.isSignedIn()
|
ApprovalInfo self = Gerrit.isSignedIn()
|
||||||
? lv.info.for_user(Gerrit.getUserAccount().getId().get())
|
? lv.info.forUser(Gerrit.getUserAccount().getId().get())
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
final String id = lv.info.name();
|
final String id = lv.info.name();
|
||||||
@@ -373,7 +373,7 @@ class ReplyBox extends Composite {
|
|||||||
|
|
||||||
CellFormatter fmt = labelsTable.getCellFormatter();
|
CellFormatter fmt = labelsTable.getCellFormatter();
|
||||||
fmt.setStyleName(row, labelHelpColumn, style.label_help());
|
fmt.setStyleName(row, labelHelpColumn, style.label_help());
|
||||||
labelsTable.setText(row, labelHelpColumn, lv.info.value_text("+1"));
|
labelsTable.setText(row, labelHelpColumn, lv.info.valueText("+1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isCheckBox(Set<Short> values) {
|
private static boolean isCheckBox(Set<Short> values) {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class RevertAction {
|
|||||||
public void onSuccess(ChangeInfo result) {
|
public void onSuccess(ChangeInfo result) {
|
||||||
sent = true;
|
sent = true;
|
||||||
hide();
|
hide();
|
||||||
Gerrit.display(PageLinks.toChange(result.legacy_id()));
|
Gerrit.display(PageLinks.toChange(result.legacyId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class Reviewers extends Composite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set(ChangeInfo info) {
|
void set(ChangeInfo info) {
|
||||||
this.changeId = info.legacy_id();
|
this.changeId = info.legacyId();
|
||||||
display(info);
|
display(info);
|
||||||
reviewerSuggestOracle.setChange(changeId);
|
reviewerSuggestOracle.setChange(changeId);
|
||||||
openForm.setVisible(Gerrit.isSignedIn());
|
openForm.setVisible(Gerrit.isSignedIn());
|
||||||
@@ -125,7 +125,7 @@ public class Reviewers extends Composite {
|
|||||||
|
|
||||||
@UiHandler("addMe")
|
@UiHandler("addMe")
|
||||||
void onAddMe(@SuppressWarnings("unused") ClickEvent e) {
|
void onAddMe(@SuppressWarnings("unused") ClickEvent e) {
|
||||||
String accountId = String.valueOf(Gerrit.getUserAccountInfo()._account_id());
|
String accountId = String.valueOf(Gerrit.getUserAccountInfo()._accountId());
|
||||||
addReviewer(accountId, false);
|
addReviewer(accountId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,22 +198,22 @@ public class Reviewers extends Composite {
|
|||||||
private void display(ChangeInfo info) {
|
private void display(ChangeInfo info) {
|
||||||
Map<Integer, AccountInfo> r = new HashMap<>();
|
Map<Integer, AccountInfo> r = new HashMap<>();
|
||||||
Map<Integer, AccountInfo> cc = new HashMap<>();
|
Map<Integer, AccountInfo> cc = new HashMap<>();
|
||||||
for (LabelInfo label : Natives.asList(info.all_labels().values())) {
|
for (LabelInfo label : Natives.asList(info.allLabels().values())) {
|
||||||
if (label.all() != null) {
|
if (label.all() != null) {
|
||||||
for (ApprovalInfo ai : Natives.asList(label.all())) {
|
for (ApprovalInfo ai : Natives.asList(label.all())) {
|
||||||
(ai.value() != 0 ? r : cc).put(ai._account_id(), ai);
|
(ai.value() != 0 ? r : cc).put(ai._accountId(), ai);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Integer i : r.keySet()) {
|
for (Integer i : r.keySet()) {
|
||||||
cc.remove(i);
|
cc.remove(i);
|
||||||
}
|
}
|
||||||
cc.remove(info.owner()._account_id());
|
cc.remove(info.owner()._accountId());
|
||||||
|
|
||||||
Set<Integer> removable = new HashSet<>();
|
Set<Integer> removable = new HashSet<>();
|
||||||
if (info.removable_reviewers() != null) {
|
if (info.removableReviewers() != null) {
|
||||||
for (AccountInfo a : Natives.asList(info.removable_reviewers())) {
|
for (AccountInfo a : Natives.asList(info.removableReviewers())) {
|
||||||
removable.add(a._account_id());
|
removable.add(a._accountId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,8 +227,8 @@ public class Reviewers extends Composite {
|
|||||||
reviewersText.setInnerSafeHtml(rHtml);
|
reviewersText.setInnerSafeHtml(rHtml);
|
||||||
ccText.setInnerSafeHtml(ccHtml);
|
ccText.setInnerSafeHtml(ccHtml);
|
||||||
if (Gerrit.isSignedIn()) {
|
if (Gerrit.isSignedIn()) {
|
||||||
int currentUser = Gerrit.getUserAccountInfo()._account_id();
|
int currentUser = Gerrit.getUserAccountInfo()._accountId();
|
||||||
boolean showAddMeButton = info.owner()._account_id() != currentUser
|
boolean showAddMeButton = info.owner()._accountId() != currentUser
|
||||||
&& !cc.containsKey(currentUser)
|
&& !cc.containsKey(currentUser)
|
||||||
&& !r.containsKey(currentUser);
|
&& !r.containsKey(currentUser);
|
||||||
addMe.setVisible(showAddMeButton);
|
addMe.setVisible(showAddMeButton);
|
||||||
@@ -241,13 +241,13 @@ public class Reviewers extends Composite {
|
|||||||
LabelInfo label = change.label(name);
|
LabelInfo label = change.label(name);
|
||||||
if (label.all() != null) {
|
if (label.all() != null) {
|
||||||
for (ApprovalInfo ai : Natives.asList(label.all())) {
|
for (ApprovalInfo ai : Natives.asList(label.all())) {
|
||||||
int id = ai._account_id();
|
int id = ai._accountId();
|
||||||
VotableInfo ad = d.get(id);
|
VotableInfo ad = d.get(id);
|
||||||
if (ad == null) {
|
if (ad == null) {
|
||||||
ad = new VotableInfo();
|
ad = new VotableInfo();
|
||||||
d.put(id, ad);
|
d.put(id, ad);
|
||||||
}
|
}
|
||||||
if (ai.has_value()) {
|
if (ai.hasValue()) {
|
||||||
ad.votable(name);
|
ad.votable(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.google.gerrit.reviewdb.client.Change;
|
|||||||
class SubmitAction {
|
class SubmitAction {
|
||||||
static void call(ChangeInfo changeInfo, RevisionInfo revisionInfo) {
|
static void call(ChangeInfo changeInfo, RevisionInfo revisionInfo) {
|
||||||
if (ChangeGlue.onSubmitChange(changeInfo, revisionInfo)) {
|
if (ChangeGlue.onSubmitChange(changeInfo, revisionInfo)) {
|
||||||
final Change.Id changeId = changeInfo.legacy_id();
|
final Change.Id changeId = changeInfo.legacyId();
|
||||||
ChangeApi.submit(
|
ChangeApi.submit(
|
||||||
changeId.get(), revisionInfo.name(),
|
changeId.get(), revisionInfo.name(),
|
||||||
new GerritCallback<SubmitInfo>() {
|
new GerritCallback<SubmitInfo>() {
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ class Topic extends Composite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set(ChangeInfo info, String revision) {
|
void set(ChangeInfo info, String revision) {
|
||||||
canEdit = info.has_actions() && info.actions().containsKey("topic");
|
canEdit = info.hasActions() && info.actions().containsKey("topic");
|
||||||
|
|
||||||
psId = new PatchSet.Id(
|
psId = new PatchSet.Id(
|
||||||
info.legacy_id(),
|
info.legacyId(),
|
||||||
info.revisions().get(revision)._number());
|
info.revisions().get(revision)._number());
|
||||||
|
|
||||||
initTopicLink(info);
|
initTopicLink(info);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ abstract class UpdateAvailableBar extends Composite {
|
|||||||
HashSet<Integer> seen = new HashSet<>();
|
HashSet<Integer> seen = new HashSet<>();
|
||||||
StringBuilder r = new StringBuilder();
|
StringBuilder r = new StringBuilder();
|
||||||
for (MessageInfo m : newMessages) {
|
for (MessageInfo m : newMessages) {
|
||||||
int a = m.author() != null ? m.author()._account_id() : 0;
|
int a = m.author() != null ? m.author()._accountId() : 0;
|
||||||
if (seen.add(a)) {
|
if (seen.add(a)) {
|
||||||
if (r.length() > 0) {
|
if (r.length() > 0) {
|
||||||
r.append(", ");
|
r.append(", ");
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class ChangeApi {
|
|||||||
input.project(emptyToNull(project));
|
input.project(emptyToNull(project));
|
||||||
input.branch(emptyToNull(branch));
|
input.branch(emptyToNull(branch));
|
||||||
input.subject(emptyToNull(subject));
|
input.subject(emptyToNull(subject));
|
||||||
input.base_change(emptyToNull(base));
|
input.baseChange(emptyToNull(base));
|
||||||
|
|
||||||
if (Gerrit.getConfig().isAllowDraftChanges()) {
|
if (Gerrit.getConfig().isAllowDraftChanges()) {
|
||||||
input.status(Change.Status.DRAFT.toString());
|
input.status(Change.Status.DRAFT.toString());
|
||||||
@@ -187,7 +187,7 @@ public class ChangeApi {
|
|||||||
/** Submit a specific revision of a change. */
|
/** Submit a specific revision of a change. */
|
||||||
public static void submit(int id, String commit, AsyncCallback<SubmitInfo> cb) {
|
public static void submit(int id, String commit, AsyncCallback<SubmitInfo> cb) {
|
||||||
SubmitInput in = SubmitInput.create();
|
SubmitInput in = SubmitInput.create();
|
||||||
in.wait_for_merge(true);
|
in.waitForMerge(true);
|
||||||
call(id, commit, "submit").post(in, cb);
|
call(id, commit, "submit").post(in, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ public class ChangeApi {
|
|||||||
public final native void branch(String b) /*-{ if(b)this.branch=b; }-*/;
|
public final native void branch(String b) /*-{ if(b)this.branch=b; }-*/;
|
||||||
public final native void project(String p) /*-{ if(p)this.project=p; }-*/;
|
public final native void project(String p) /*-{ if(p)this.project=p; }-*/;
|
||||||
public final native void subject(String s) /*-{ if(s)this.subject=s; }-*/;
|
public final native void subject(String s) /*-{ if(s)this.subject=s; }-*/;
|
||||||
public final native void base_change(String b) /*-{ if(b)this.base_change=b; }-*/;
|
public final native void baseChange(String b) /*-{ if(b)this.base_change=b; }-*/;
|
||||||
public final native void status(String s) /*-{ if(s)this.status=s; }-*/;
|
public final native void status(String s) /*-{ if(s)this.status=s; }-*/;
|
||||||
|
|
||||||
protected CreateChangeInput() {
|
protected CreateChangeInput() {
|
||||||
@@ -281,7 +281,7 @@ public class ChangeApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class SubmitInput extends JavaScriptObject {
|
private static class SubmitInput extends JavaScriptObject {
|
||||||
final native void wait_for_merge(boolean b) /*-{ this.wait_for_merge=b; }-*/;
|
final native void waitForMerge(boolean b) /*-{ this.wait_for_merge=b; }-*/;
|
||||||
|
|
||||||
static SubmitInput create() {
|
static SubmitInput create() {
|
||||||
return (SubmitInput) createObject();
|
return (SubmitInput) createObject();
|
||||||
|
|||||||
@@ -76,15 +76,15 @@ public class ChangeEditApi {
|
|||||||
public static void rename(int id, String path, String newPath,
|
public static void rename(int id, String path, String newPath,
|
||||||
AsyncCallback<VoidResult> cb) {
|
AsyncCallback<VoidResult> cb) {
|
||||||
Input in = Input.create();
|
Input in = Input.create();
|
||||||
in.old_path(path);
|
in.oldPath(path);
|
||||||
in.new_path(newPath);
|
in.newPath(newPath);
|
||||||
ChangeApi.edit(id).post(in, cb);
|
ChangeApi.edit(id).post(in, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Restore (undo delete/modify) a file in the pending edit. */
|
/** Restore (undo delete/modify) a file in the pending edit. */
|
||||||
public static void restore(int id, String path, AsyncCallback<VoidResult> cb) {
|
public static void restore(int id, String path, AsyncCallback<VoidResult> cb) {
|
||||||
Input in = Input.create();
|
Input in = Input.create();
|
||||||
in.restore_path(path);
|
in.restorePath(path);
|
||||||
ChangeApi.edit(id).post(in, cb);
|
ChangeApi.edit(id).post(in, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,9 +101,9 @@ public class ChangeEditApi {
|
|||||||
return createObject().cast();
|
return createObject().cast();
|
||||||
}
|
}
|
||||||
|
|
||||||
final native void restore_path(String p) /*-{ this.restore_path=p }-*/;
|
final native void restorePath(String p) /*-{ this.restore_path=p }-*/;
|
||||||
final native void old_path(String p) /*-{ this.old_path=p }-*/;
|
final native void oldPath(String p) /*-{ this.old_path=p }-*/;
|
||||||
final native void new_path(String p) /*-{ this.new_path=p }-*/;
|
final native void newPath(String p) /*-{ this.new_path=p }-*/;
|
||||||
|
|
||||||
protected Input() {
|
protected Input() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,24 +41,24 @@ import java.util.TreeSet;
|
|||||||
|
|
||||||
public class ChangeInfo extends JavaScriptObject {
|
public class ChangeInfo extends JavaScriptObject {
|
||||||
public final void init() {
|
public final void init() {
|
||||||
if (all_labels() != null) {
|
if (allLabels() != null) {
|
||||||
all_labels().copyKeysIntoChildren("_name");
|
allLabels().copyKeysIntoChildren("_name");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Project.NameKey project_name_key() {
|
public final Project.NameKey projectNameKey() {
|
||||||
return new Project.NameKey(project());
|
return new Project.NameKey(project());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Change.Id legacy_id() {
|
public final Change.Id legacyId() {
|
||||||
return new Change.Id(_number());
|
return new Change.Id(_number());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Timestamp created() {
|
public final Timestamp created() {
|
||||||
Timestamp ts = _get_cts();
|
Timestamp ts = _getCts();
|
||||||
if (ts == null) {
|
if (ts == null) {
|
||||||
ts = JavaSqlTimestamp_JsonSerializer.parseTimestamp(createdRaw());
|
ts = JavaSqlTimestamp_JsonSerializer.parseTimestamp(createdRaw());
|
||||||
_set_cts(ts);
|
_setCts(ts);
|
||||||
}
|
}
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
@@ -66,18 +66,18 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
public final boolean hasEditBasedOnCurrentPatchSet() {
|
public final boolean hasEditBasedOnCurrentPatchSet() {
|
||||||
JsArray<RevisionInfo> revList = revisions().values();
|
JsArray<RevisionInfo> revList = revisions().values();
|
||||||
RevisionInfo.sortRevisionInfoByNumber(revList);
|
RevisionInfo.sortRevisionInfoByNumber(revList);
|
||||||
return revList.get(revList.length() - 1).is_edit();
|
return revList.get(revList.length() - 1).isEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final native Timestamp _get_cts() /*-{ return this._cts; }-*/;
|
private final native Timestamp _getCts() /*-{ return this._cts; }-*/;
|
||||||
private final native void _set_cts(Timestamp ts) /*-{ this._cts = ts; }-*/;
|
private final native void _setCts(Timestamp ts) /*-{ this._cts = ts; }-*/;
|
||||||
|
|
||||||
public final Timestamp updated() {
|
public final Timestamp updated() {
|
||||||
return JavaSqlTimestamp_JsonSerializer.parseTimestamp(updatedRaw());
|
return JavaSqlTimestamp_JsonSerializer.parseTimestamp(updatedRaw());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String id_abbreviated() {
|
public final String idAbbreviated() {
|
||||||
return new Change.Key(change_id()).abbreviate();
|
return new Change.Key(changeId()).abbreviate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Change.Status status() {
|
public final Change.Status status() {
|
||||||
@@ -85,14 +85,14 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final Set<String> labels() {
|
public final Set<String> labels() {
|
||||||
return all_labels().keySet();
|
return allLabels().keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final native String id() /*-{ return this.id; }-*/;
|
public final native String id() /*-{ return this.id; }-*/;
|
||||||
public final native String project() /*-{ return this.project; }-*/;
|
public final native String project() /*-{ return this.project; }-*/;
|
||||||
public final native String branch() /*-{ return this.branch; }-*/;
|
public final native String branch() /*-{ return this.branch; }-*/;
|
||||||
public final native String topic() /*-{ return this.topic; }-*/;
|
public final native String topic() /*-{ return this.topic; }-*/;
|
||||||
public final native String change_id() /*-{ return this.change_id; }-*/;
|
public final native String changeId() /*-{ return this.change_id; }-*/;
|
||||||
public final native boolean mergeable() /*-{ return this.mergeable || false; }-*/;
|
public final native boolean mergeable() /*-{ return this.mergeable || false; }-*/;
|
||||||
public final native int insertions() /*-{ return this.insertions; }-*/;
|
public final native int insertions() /*-{ return this.insertions; }-*/;
|
||||||
public final native int deletions() /*-{ return this.deletions; }-*/;
|
public final native int deletions() /*-{ return this.deletions; }-*/;
|
||||||
@@ -103,30 +103,30 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
private final native String updatedRaw() /*-{ return this.updated; }-*/;
|
private final native String updatedRaw() /*-{ return this.updated; }-*/;
|
||||||
public final native boolean starred() /*-{ return this.starred ? true : false; }-*/;
|
public final native boolean starred() /*-{ return this.starred ? true : false; }-*/;
|
||||||
public final native boolean reviewed() /*-{ return this.reviewed ? true : false; }-*/;
|
public final native boolean reviewed() /*-{ return this.reviewed ? true : false; }-*/;
|
||||||
public final native NativeMap<LabelInfo> all_labels() /*-{ return this.labels; }-*/;
|
public final native NativeMap<LabelInfo> allLabels() /*-{ return this.labels; }-*/;
|
||||||
public final native LabelInfo label(String n) /*-{ return this.labels[n]; }-*/;
|
public final native LabelInfo label(String n) /*-{ return this.labels[n]; }-*/;
|
||||||
public final native String current_revision() /*-{ return this.current_revision; }-*/;
|
public final native String currentRevision() /*-{ return this.current_revision; }-*/;
|
||||||
public final native void set_current_revision(String r) /*-{ this.current_revision = r; }-*/;
|
public final native void setCurrentRevision(String r) /*-{ this.current_revision = r; }-*/;
|
||||||
private final native void set_submittable(boolean x) /*-{ this.submittable = x; }-*/;
|
private final native void setSubmittable(boolean x) /*-{ this.submittable = x; }-*/;
|
||||||
public final native NativeMap<RevisionInfo> revisions() /*-{ return this.revisions; }-*/;
|
public final native NativeMap<RevisionInfo> revisions() /*-{ return this.revisions; }-*/;
|
||||||
public final native RevisionInfo revision(String n) /*-{ return this.revisions[n]; }-*/;
|
public final native RevisionInfo revision(String n) /*-{ return this.revisions[n]; }-*/;
|
||||||
public final native JsArray<MessageInfo> messages() /*-{ return this.messages; }-*/;
|
public final native JsArray<MessageInfo> messages() /*-{ return this.messages; }-*/;
|
||||||
public final native void set_edit(EditInfo edit) /*-{ this.edit = edit; }-*/;
|
public final native void setEdit(EditInfo edit) /*-{ this.edit = edit; }-*/;
|
||||||
public final native EditInfo edit() /*-{ return this.edit; }-*/;
|
public final native EditInfo edit() /*-{ return this.edit; }-*/;
|
||||||
public final native boolean has_edit() /*-{ return this.hasOwnProperty('edit') }-*/;
|
public final native boolean hasEdit() /*-{ return this.hasOwnProperty('edit') }-*/;
|
||||||
public final native JsArrayString hashtags() /*-{ return this.hashtags; }-*/;
|
public final native JsArrayString hashtags() /*-{ return this.hashtags; }-*/;
|
||||||
|
|
||||||
public final native boolean has_permitted_labels()
|
public final native boolean hasPermittedLabels()
|
||||||
/*-{ return this.hasOwnProperty('permitted_labels') }-*/;
|
/*-{ return this.hasOwnProperty('permitted_labels') }-*/;
|
||||||
public final native NativeMap<JsArrayString> permitted_labels()
|
public final native NativeMap<JsArrayString> permittedLabels()
|
||||||
/*-{ return this.permitted_labels; }-*/;
|
/*-{ return this.permitted_labels; }-*/;
|
||||||
public final native JsArrayString permitted_values(String n)
|
public final native JsArrayString permittedValues(String n)
|
||||||
/*-{ return this.permitted_labels[n]; }-*/;
|
/*-{ return this.permitted_labels[n]; }-*/;
|
||||||
|
|
||||||
public final native JsArray<AccountInfo> removable_reviewers()
|
public final native JsArray<AccountInfo> removableReviewers()
|
||||||
/*-{ return this.removable_reviewers; }-*/;
|
/*-{ return this.removable_reviewers; }-*/;
|
||||||
|
|
||||||
public final native boolean has_actions() /*-{ return this.hasOwnProperty('actions') }-*/;
|
public final native boolean hasActions() /*-{ return this.hasOwnProperty('actions') }-*/;
|
||||||
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions; }-*/;
|
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions; }-*/;
|
||||||
|
|
||||||
final native int _number() /*-{ return this._number; }-*/;
|
final native int _number() /*-{ return this._number; }-*/;
|
||||||
@@ -151,14 +151,14 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
public final int getMissingLabelIndex() {
|
public final int getMissingLabelIndex() {
|
||||||
int i = -1;
|
int i = -1;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
List<LabelInfo> labels = Natives.asList(all_labels().values());
|
List<LabelInfo> labels = Natives.asList(allLabels().values());
|
||||||
for (LabelInfo label : labels) {
|
for (LabelInfo label : labels) {
|
||||||
i++;
|
i++;
|
||||||
if (!permitted_labels().containsKey(label.name())) {
|
if (!permittedLabels().containsKey(label.name())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
JsArrayString values = permitted_values(label.name());
|
JsArrayString values = permittedValues(label.name());
|
||||||
if (values.length() == 0) {
|
if (values.length() == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
if (ret != -1) {
|
if (ret != -1) {
|
||||||
// more than one label is missing, so it's unclear which to quick
|
// more than one label is missing, so it's unclear which to quick
|
||||||
// approve, return -1
|
// approve, return -1
|
||||||
set_submittable(false);
|
setSubmittable(false);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
ret = i;
|
ret = i;
|
||||||
@@ -181,11 +181,11 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
case REJECT: // Submit cannot happen, do not quick approve.
|
case REJECT: // Submit cannot happen, do not quick approve.
|
||||||
case IMPOSSIBLE:
|
case IMPOSSIBLE:
|
||||||
set_submittable(false);
|
setSubmittable(false);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_submittable(ret == -1);
|
setSubmittable(ret == -1);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,10 +213,10 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
public final native AccountInfo disliked() /*-{ return this.disliked; }-*/;
|
public final native AccountInfo disliked() /*-{ return this.disliked; }-*/;
|
||||||
|
|
||||||
public final native JsArray<ApprovalInfo> all() /*-{ return this.all; }-*/;
|
public final native JsArray<ApprovalInfo> all() /*-{ return this.all; }-*/;
|
||||||
public final ApprovalInfo for_user(int user) {
|
public final ApprovalInfo forUser(int user) {
|
||||||
JsArray<ApprovalInfo> all = all();
|
JsArray<ApprovalInfo> all = all();
|
||||||
for (int i = 0; all != null && i < all.length(); i++) {
|
for (int i = 0; all != null && i < all.length(); i++) {
|
||||||
if (all.get(i)._account_id() == user) {
|
if (all.get(i)._accountId() == user) {
|
||||||
return all.get(i);
|
return all.get(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,7 +227,7 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
public final Set<String> values() {
|
public final Set<String> values() {
|
||||||
return Natives.keys(_values());
|
return Natives.keys(_values());
|
||||||
}
|
}
|
||||||
public final native String value_text(String n) /*-{ return this.values[n]; }-*/;
|
public final native String valueText(String n) /*-{ return this.values[n]; }-*/;
|
||||||
|
|
||||||
public final native boolean optional() /*-{ return this.optional ? true : false; }-*/;
|
public final native boolean optional() /*-{ return this.optional ? true : false; }-*/;
|
||||||
public final native boolean blocking() /*-{ return this.blocking ? true : false; }-*/;
|
public final native boolean blocking() /*-{ return this.blocking ? true : false; }-*/;
|
||||||
@@ -240,11 +240,11 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
return 0;
|
return 0;
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
public final String max_value() {
|
public final String maxValue() {
|
||||||
return LabelValue.formatValue(value_set().last());
|
return LabelValue.formatValue(valueSet().last());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final SortedSet<Short> value_set() {
|
public final SortedSet<Short> valueSet() {
|
||||||
SortedSet<Short> values = new TreeSet<>();
|
SortedSet<Short> values = new TreeSet<>();
|
||||||
for (String v : values()) {
|
for (String v : values()) {
|
||||||
values.add(parseValue(v));
|
values.add(parseValue(v));
|
||||||
@@ -266,7 +266,7 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class ApprovalInfo extends AccountInfo {
|
public static class ApprovalInfo extends AccountInfo {
|
||||||
public final native boolean has_value() /*-{ return this.hasOwnProperty('value'); }-*/;
|
public final native boolean hasValue() /*-{ return this.hasOwnProperty('value'); }-*/;
|
||||||
public final native short value() /*-{ return this.value || 0; }-*/;
|
public final native short value() /*-{ return this.value || 0; }-*/;
|
||||||
|
|
||||||
protected ApprovalInfo() {
|
protected ApprovalInfo() {
|
||||||
@@ -275,17 +275,17 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public static class EditInfo extends JavaScriptObject {
|
public static class EditInfo extends JavaScriptObject {
|
||||||
public final native String name() /*-{ return this.name; }-*/;
|
public final native String name() /*-{ return this.name; }-*/;
|
||||||
public final native String set_name(String n) /*-{ this.name = n; }-*/;
|
public final native String setName(String n) /*-{ this.name = n; }-*/;
|
||||||
public final native String base_revision() /*-{ return this.base_revision; }-*/;
|
public final native String baseRevision() /*-{ return this.base_revision; }-*/;
|
||||||
public final native CommitInfo commit() /*-{ return this.commit; }-*/;
|
public final native CommitInfo commit() /*-{ return this.commit; }-*/;
|
||||||
|
|
||||||
public final native boolean has_actions() /*-{ return this.hasOwnProperty('actions') }-*/;
|
public final native boolean hasActions() /*-{ return this.hasOwnProperty('actions') }-*/;
|
||||||
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions; }-*/;
|
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions; }-*/;
|
||||||
|
|
||||||
public final native boolean has_fetch() /*-{ return this.hasOwnProperty('fetch') }-*/;
|
public final native boolean hasFetch() /*-{ return this.hasOwnProperty('fetch') }-*/;
|
||||||
public final native NativeMap<FetchInfo> fetch() /*-{ return this.fetch; }-*/;
|
public final native NativeMap<FetchInfo> fetch() /*-{ return this.fetch; }-*/;
|
||||||
|
|
||||||
public final native boolean has_files() /*-{ return this.hasOwnProperty('files') }-*/;
|
public final native boolean hasFiles() /*-{ return this.hasOwnProperty('files') }-*/;
|
||||||
public final native NativeMap<FileInfo> files() /*-{ return this.files; }-*/;
|
public final native NativeMap<FileInfo> files() /*-{ return this.files; }-*/;
|
||||||
|
|
||||||
protected EditInfo() {
|
protected EditInfo() {
|
||||||
@@ -307,19 +307,19 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
public final native int _number() /*-{ return this._number; }-*/;
|
public final native int _number() /*-{ return this._number; }-*/;
|
||||||
public final native String name() /*-{ return this.name; }-*/;
|
public final native String name() /*-{ return this.name; }-*/;
|
||||||
public final native boolean draft() /*-{ return this.draft || false; }-*/;
|
public final native boolean draft() /*-{ return this.draft || false; }-*/;
|
||||||
public final native boolean has_draft_comments() /*-{ return this.has_draft_comments || false; }-*/;
|
public final native boolean hasDraftComments() /*-{ return this.has_draft_comments || false; }-*/;
|
||||||
public final native boolean is_edit() /*-{ return this._number == 0; }-*/;
|
public final native boolean isEdit() /*-{ return this._number == 0; }-*/;
|
||||||
public final native CommitInfo commit() /*-{ return this.commit; }-*/;
|
public final native CommitInfo commit() /*-{ return this.commit; }-*/;
|
||||||
public final native void set_commit(CommitInfo c) /*-{ this.commit = c; }-*/;
|
public final native void setCommit(CommitInfo c) /*-{ this.commit = c; }-*/;
|
||||||
public final native String edit_base() /*-{ return this.edit_base; }-*/;
|
public final native String editBase() /*-{ return this.edit_base; }-*/;
|
||||||
|
|
||||||
public final native boolean has_files() /*-{ return this.hasOwnProperty('files') }-*/;
|
public final native boolean hasFiles() /*-{ return this.hasOwnProperty('files') }-*/;
|
||||||
public final native NativeMap<FileInfo> files() /*-{ return this.files; }-*/;
|
public final native NativeMap<FileInfo> files() /*-{ return this.files; }-*/;
|
||||||
|
|
||||||
public final native boolean has_actions() /*-{ return this.hasOwnProperty('actions') }-*/;
|
public final native boolean hasActions() /*-{ return this.hasOwnProperty('actions') }-*/;
|
||||||
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions; }-*/;
|
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions; }-*/;
|
||||||
|
|
||||||
public final native boolean has_fetch() /*-{ return this.hasOwnProperty('fetch') }-*/;
|
public final native boolean hasFetch() /*-{ return this.hasOwnProperty('fetch') }-*/;
|
||||||
public final native NativeMap<FetchInfo> fetch() /*-{ return this.fetch; }-*/;
|
public final native NativeMap<FetchInfo> fetch() /*-{ return this.fetch; }-*/;
|
||||||
|
|
||||||
public static void sortRevisionInfoByNumber(JsArray<RevisionInfo> list) {
|
public static void sortRevisionInfoByNumber(JsArray<RevisionInfo> list) {
|
||||||
@@ -331,7 +331,7 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int num(RevisionInfo r) {
|
private int num(RevisionInfo r) {
|
||||||
return !r.is_edit() ? 2 * (r._number() - 1) + 1 : 2 * editParent;
|
return !r.isEdit() ? 2 * (r._number() - 1) + 1 : 2 * editParent;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -340,8 +340,8 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
for (int i = 0; i < list.length(); i++) {
|
for (int i = 0; i < list.length(); i++) {
|
||||||
// edit under revisions?
|
// edit under revisions?
|
||||||
RevisionInfo editInfo = list.get(i);
|
RevisionInfo editInfo = list.get(i);
|
||||||
if (editInfo.is_edit()) {
|
if (editInfo.isEdit()) {
|
||||||
String parentRevision = editInfo.edit_base();
|
String parentRevision = editInfo.editBase();
|
||||||
// find parent
|
// find parent
|
||||||
for (int j = 0; j < list.length(); j++) {
|
for (int j = 0; j < list.length(); j++) {
|
||||||
RevisionInfo parentInfo = list.get(j);
|
RevisionInfo parentInfo = list.get(j);
|
||||||
@@ -381,7 +381,7 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
public final native GitPerson committer() /*-{ return this.committer; }-*/;
|
public final native GitPerson committer() /*-{ return this.committer; }-*/;
|
||||||
public final native String subject() /*-{ return this.subject; }-*/;
|
public final native String subject() /*-{ return this.subject; }-*/;
|
||||||
public final native String message() /*-{ return this.message; }-*/;
|
public final native String message() /*-{ return this.message; }-*/;
|
||||||
public final native JsArray<WebLinkInfo> web_links() /*-{ return this.web_links; }-*/;
|
public final native JsArray<WebLinkInfo> webLinks() /*-{ return this.web_links; }-*/;
|
||||||
|
|
||||||
protected CommitInfo() {
|
protected CommitInfo() {
|
||||||
}
|
}
|
||||||
@@ -415,7 +415,7 @@ public class ChangeInfo extends JavaScriptObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class MergeableInfo extends JavaScriptObject {
|
public static class MergeableInfo extends JavaScriptObject {
|
||||||
public final native String submit_type() /*-{ return this.submit_type }-*/;
|
public final native String submitType() /*-{ return this.submit_type }-*/;
|
||||||
public final native boolean mergeable() /*-{ return this.mergeable }-*/;
|
public final native boolean mergeable() /*-{ return this.mergeable }-*/;
|
||||||
|
|
||||||
protected MergeableInfo() {
|
protected MergeableInfo() {
|
||||||
|
|||||||
@@ -118,13 +118,13 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object getRowItemKey(final ChangeInfo item) {
|
protected Object getRowItemKey(final ChangeInfo item) {
|
||||||
return item.legacy_id();
|
return item.legacyId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onOpenRow(final int row) {
|
protected void onOpenRow(final int row) {
|
||||||
final ChangeInfo c = getRowItem(row);
|
final ChangeInfo c = getRowItem(row);
|
||||||
final Change.Id id = c.legacy_id();
|
final Change.Id id = c.legacyId();
|
||||||
Gerrit.display(PageLinks.toChange(id));
|
Gerrit.display(PageLinks.toChange(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,10 +208,10 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
|
|||||||
CellFormatter fmt = table.getCellFormatter();
|
CellFormatter fmt = table.getCellFormatter();
|
||||||
if (Gerrit.isSignedIn()) {
|
if (Gerrit.isSignedIn()) {
|
||||||
table.setWidget(row, C_STAR, StarredChanges.createIcon(
|
table.setWidget(row, C_STAR, StarredChanges.createIcon(
|
||||||
c.legacy_id(),
|
c.legacyId(),
|
||||||
c.starred()));
|
c.starred()));
|
||||||
}
|
}
|
||||||
table.setWidget(row, C_ID, new TableChangeLink(String.valueOf(c.legacy_id()), c));
|
table.setWidget(row, C_ID, new TableChangeLink(String.valueOf(c.legacyId()), c));
|
||||||
|
|
||||||
String subject = Util.cropSubject(c.subject());
|
String subject = Util.cropSubject(c.subject());
|
||||||
table.setWidget(row, C_SUBJECT, new TableChangeLink(subject, c));
|
table.setWidget(row, C_SUBJECT, new TableChangeLink(subject, c));
|
||||||
@@ -229,8 +229,8 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
|
|||||||
table.setText(row, C_OWNER, "");
|
table.setText(row, C_OWNER, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
table.setWidget(row, C_PROJECT, new ProjectLink(c.project_name_key()));
|
table.setWidget(row, C_PROJECT, new ProjectLink(c.projectNameKey()));
|
||||||
table.setWidget(row, C_BRANCH, new BranchLink(c.project_name_key(), c
|
table.setWidget(row, C_BRANCH, new BranchLink(c.projectNameKey(), c
|
||||||
.status(), c.branch(), c.topic()));
|
.status(), c.branch(), c.topic()));
|
||||||
if (Gerrit.isSignedIn()
|
if (Gerrit.isSignedIn()
|
||||||
&& Gerrit.getUserAccount().getGeneralPreferences()
|
&& Gerrit.getUserAccount().getGeneralPreferences()
|
||||||
@@ -447,7 +447,7 @@ public class ChangeTable extends NavigationTable<ChangeInfo> {
|
|||||||
|
|
||||||
private final class TableChangeLink extends ChangeLink {
|
private final class TableChangeLink extends ChangeLink {
|
||||||
private TableChangeLink(final String text, final ChangeInfo c) {
|
private TableChangeLink(final String text, final ChangeInfo c) {
|
||||||
super(text, c.legacy_id());
|
super(text, c.legacyId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class CommentInfo extends JavaScriptObject {
|
|||||||
n.path(path);
|
n.path(path);
|
||||||
n.side(side);
|
n.side(side);
|
||||||
if (range != null) {
|
if (range != null) {
|
||||||
n.line(range.end_line());
|
n.line(range.endLine());
|
||||||
n.range(range);
|
n.range(range);
|
||||||
} else if (line > 0) {
|
} else if (line > 0) {
|
||||||
n.line(line);
|
n.line(line);
|
||||||
@@ -41,11 +41,11 @@ public class CommentInfo extends JavaScriptObject {
|
|||||||
CommentInfo n = createObject().cast();
|
CommentInfo n = createObject().cast();
|
||||||
n.path(r.path());
|
n.path(r.path());
|
||||||
n.side(r.side());
|
n.side(r.side());
|
||||||
n.in_reply_to(r.id());
|
n.inReplyTo(r.id());
|
||||||
if (r.has_range()) {
|
if (r.hasRange()) {
|
||||||
n.line(r.range().end_line());
|
n.line(r.range().endLine());
|
||||||
n.range(r.range());
|
n.range(r.range());
|
||||||
} else if (r.has_line()) {
|
} else if (r.hasLine()) {
|
||||||
n.line(r.line());
|
n.line(r.line());
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
@@ -56,12 +56,12 @@ public class CommentInfo extends JavaScriptObject {
|
|||||||
n.path(s.path());
|
n.path(s.path());
|
||||||
n.side(s.side());
|
n.side(s.side());
|
||||||
n.id(s.id());
|
n.id(s.id());
|
||||||
n.in_reply_to(s.in_reply_to());
|
n.inReplyTo(s.inReplyTo());
|
||||||
n.message(s.message());
|
n.message(s.message());
|
||||||
if (s.has_range()) {
|
if (s.hasRange()) {
|
||||||
n.line(s.range().end_line());
|
n.line(s.range().endLine());
|
||||||
n.range(s.range());
|
n.range(s.range());
|
||||||
} else if (s.has_line()) {
|
} else if (s.hasLine()) {
|
||||||
n.line(s.line());
|
n.line(s.line());
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
@@ -71,7 +71,7 @@ public class CommentInfo extends JavaScriptObject {
|
|||||||
public final native void id(String i) /*-{ this.id = i }-*/;
|
public final native void id(String i) /*-{ this.id = i }-*/;
|
||||||
public final native void line(int n) /*-{ this.line = n }-*/;
|
public final native void line(int n) /*-{ this.line = n }-*/;
|
||||||
public final native void range(CommentRange r) /*-{ this.range = r }-*/;
|
public final native void range(CommentRange r) /*-{ this.range = r }-*/;
|
||||||
public final native void in_reply_to(String i) /*-{ this.in_reply_to = i }-*/;
|
public final native void inReplyTo(String i) /*-{ this.in_reply_to = i }-*/;
|
||||||
public final native void message(String m) /*-{ this.message = m }-*/;
|
public final native void message(String m) /*-{ this.message = m }-*/;
|
||||||
|
|
||||||
public final void side(Side side) {
|
public final void side(Side side) {
|
||||||
@@ -81,8 +81,8 @@ public class CommentInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public final native String path() /*-{ return this.path }-*/;
|
public final native String path() /*-{ return this.path }-*/;
|
||||||
public final native String id() /*-{ return this.id }-*/;
|
public final native String id() /*-{ return this.id }-*/;
|
||||||
public final native String in_reply_to() /*-{ return this.in_reply_to }-*/;
|
public final native String inReplyTo() /*-{ return this.in_reply_to }-*/;
|
||||||
public final native int patch_set() /*-{ return this.patch_set }-*/;
|
public final native int patchSet() /*-{ return this.patch_set }-*/;
|
||||||
|
|
||||||
public final Side side() {
|
public final Side side() {
|
||||||
String s = sideRaw();
|
String s = sideRaw();
|
||||||
@@ -109,8 +109,8 @@ public class CommentInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public final native AccountInfo author() /*-{ return this.author }-*/;
|
public final native AccountInfo author() /*-{ return this.author }-*/;
|
||||||
public final native int line() /*-{ return this.line || 0 }-*/;
|
public final native int line() /*-{ return this.line || 0 }-*/;
|
||||||
public final native boolean has_line() /*-{ return this.hasOwnProperty('line') }-*/;
|
public final native boolean hasLine() /*-{ return this.hasOwnProperty('line') }-*/;
|
||||||
public final native boolean has_range() /*-{ return this.hasOwnProperty('range') }-*/;
|
public final native boolean hasRange() /*-{ return this.hasOwnProperty('range') }-*/;
|
||||||
public final native CommentRange range() /*-{ return this.range }-*/;
|
public final native CommentRange range() /*-{ return this.range }-*/;
|
||||||
public final native String message() /*-{ return this.message }-*/;
|
public final native String message() /*-{ return this.message }-*/;
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class QueryScreen extends PagedSingleListScreen implements
|
|||||||
if (isAttached()) {
|
if (isAttached()) {
|
||||||
if (result.length() == 1 && isSingleQuery(query)) {
|
if (result.length() == 1 && isSingleQuery(query)) {
|
||||||
ChangeInfo c = result.get(0);
|
ChangeInfo c = result.get(0);
|
||||||
Change.Id id = c.legacy_id();
|
Change.Id id = c.legacyId();
|
||||||
Gerrit.display(PageLinks.toChange(id));
|
Gerrit.display(PageLinks.toChange(id));
|
||||||
} else {
|
} else {
|
||||||
display(result);
|
display(result);
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class ChunkManager {
|
|||||||
padding = new ArrayList<>();
|
padding = new ArrayList<>();
|
||||||
paddingDivs = new ArrayList<>();
|
paddingDivs = new ArrayList<>();
|
||||||
|
|
||||||
String diffColor = diff.meta_a() == null || diff.meta_b() == null
|
String diffColor = diff.metaA() == null || diff.metaB() == null
|
||||||
? DiffTable.style.intralineBg()
|
? DiffTable.style.intralineBg()
|
||||||
: DiffTable.style.diff();
|
: DiffTable.style.diff();
|
||||||
|
|
||||||
@@ -175,8 +175,8 @@ class ChunkManager {
|
|||||||
|
|
||||||
colorLines(cmA, color, startA, aLen);
|
colorLines(cmA, color, startA, aLen);
|
||||||
colorLines(cmB, color, startB, bLen);
|
colorLines(cmB, color, startB, bLen);
|
||||||
markEdit(cmA, startA, a, region.edit_a());
|
markEdit(cmA, startA, a, region.editA());
|
||||||
markEdit(cmB, startB, b, region.edit_b());
|
markEdit(cmB, startB, b, region.editB());
|
||||||
addPadding(cmA, startA + aLen - 1, bLen - aLen);
|
addPadding(cmA, startA + aLen - 1, bLen - aLen);
|
||||||
addPadding(cmB, startB + bLen - 1, aLen - bLen);
|
addPadding(cmB, startB + bLen - 1, aLen - bLen);
|
||||||
addGutterTag(region, startA, startB);
|
addGutterTag(region, startA, startB);
|
||||||
|
|||||||
@@ -218,8 +218,8 @@ class CommentManager {
|
|||||||
info,
|
info,
|
||||||
expandAll);
|
expandAll);
|
||||||
|
|
||||||
if (info.in_reply_to() != null) {
|
if (info.inReplyTo() != null) {
|
||||||
PublishedBox r = published.get(info.in_reply_to());
|
PublishedBox r = published.get(info.inReplyTo());
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
r.setReplyBox(box);
|
r.setReplyBox(box);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ public class CommentRange extends JavaScriptObject {
|
|||||||
to.line() + 1, to.ch());
|
to.line() + 1, to.ch());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final native int start_line() /*-{ return this.start_line; }-*/;
|
public final native int startLine() /*-{ return this.start_line; }-*/;
|
||||||
public final native int start_character() /*-{ return this.start_character; }-*/;
|
public final native int startCharacter() /*-{ return this.start_character; }-*/;
|
||||||
public final native int end_line() /*-{ return this.end_line; }-*/;
|
public final native int endLine() /*-{ return this.end_line; }-*/;
|
||||||
public final native int end_character() /*-{ return this.end_character; }-*/;
|
public final native int endCharacter() /*-{ return this.end_character; }-*/;
|
||||||
|
|
||||||
private final native void set(int sl, int sc, int el, int ec) /*-{
|
private final native void set(int sl, int sc, int el, int ec) /*-{
|
||||||
this.start_line = sl;
|
this.start_line = sl;
|
||||||
|
|||||||
@@ -30,24 +30,24 @@ public class DiffInfo extends JavaScriptObject {
|
|||||||
public static final String GITLINK = "x-git/gitlink";
|
public static final String GITLINK = "x-git/gitlink";
|
||||||
public static final String SYMLINK = "x-git/symlink";
|
public static final String SYMLINK = "x-git/symlink";
|
||||||
|
|
||||||
public final native FileMeta meta_a() /*-{ return this.meta_a; }-*/;
|
public final native FileMeta metaA() /*-{ return this.meta_a; }-*/;
|
||||||
public final native FileMeta meta_b() /*-{ return this.meta_b; }-*/;
|
public final native FileMeta metaB() /*-{ return this.meta_b; }-*/;
|
||||||
public final native JsArrayString diff_header() /*-{ return this.diff_header; }-*/;
|
public final native JsArrayString diffHeader() /*-{ return this.diff_header; }-*/;
|
||||||
public final native JsArray<Region> content() /*-{ return this.content; }-*/;
|
public final native JsArray<Region> content() /*-{ return this.content; }-*/;
|
||||||
public final native JsArray<DiffWebLinkInfo> web_links() /*-{ return this.web_links; }-*/;
|
public final native JsArray<DiffWebLinkInfo> webLinks() /*-{ return this.web_links; }-*/;
|
||||||
public final native boolean binary() /*-{ return this.binary || false; }-*/;
|
public final native boolean binary() /*-{ return this.binary || false; }-*/;
|
||||||
|
|
||||||
public final List<WebLinkInfo> side_by_side_web_links() {
|
public final List<WebLinkInfo> sideBySideWebLinks() {
|
||||||
return filterWebLinks(DiffView.SIDE_BY_SIDE);
|
return filterWebLinks(DiffView.SIDE_BY_SIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final List<WebLinkInfo> unified_web_links() {
|
public final List<WebLinkInfo> unifiedWebLinks() {
|
||||||
return filterWebLinks(DiffView.UNIFIED_DIFF);
|
return filterWebLinks(DiffView.UNIFIED_DIFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final List<WebLinkInfo> filterWebLinks(DiffView diffView) {
|
private final List<WebLinkInfo> filterWebLinks(DiffView diffView) {
|
||||||
List<WebLinkInfo> filteredDiffWebLinks = new LinkedList<>();
|
List<WebLinkInfo> filteredDiffWebLinks = new LinkedList<>();
|
||||||
List<DiffWebLinkInfo> allDiffWebLinks = Natives.asList(web_links());
|
List<DiffWebLinkInfo> allDiffWebLinks = Natives.asList(webLinks());
|
||||||
if (allDiffWebLinks != null) {
|
if (allDiffWebLinks != null) {
|
||||||
for (DiffWebLinkInfo webLink : allDiffWebLinks) {
|
for (DiffWebLinkInfo webLink : allDiffWebLinks) {
|
||||||
if (diffView == DiffView.SIDE_BY_SIDE
|
if (diffView == DiffView.SIDE_BY_SIDE
|
||||||
@@ -63,22 +63,22 @@ public class DiffInfo extends JavaScriptObject {
|
|||||||
return filteredDiffWebLinks;
|
return filteredDiffWebLinks;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final ChangeType change_type() {
|
public final ChangeType changeType() {
|
||||||
return ChangeType.valueOf(change_typeRaw());
|
return ChangeType.valueOf(changeTypeRaw());
|
||||||
}
|
}
|
||||||
private final native String change_typeRaw()
|
private final native String changeTypeRaw()
|
||||||
/*-{ return this.change_type }-*/;
|
/*-{ return this.change_type }-*/;
|
||||||
|
|
||||||
public final IntraLineStatus intraline_status() {
|
public final IntraLineStatus intralineStatus() {
|
||||||
String s = intraline_statusRaw();
|
String s = intralineStatusRaw();
|
||||||
return s != null
|
return s != null
|
||||||
? IntraLineStatus.valueOf(s)
|
? IntraLineStatus.valueOf(s)
|
||||||
: IntraLineStatus.OFF;
|
: IntraLineStatus.OFF;
|
||||||
}
|
}
|
||||||
private final native String intraline_statusRaw()
|
private final native String intralineStatusRaw()
|
||||||
/*-{ return this.intraline_status }-*/;
|
/*-{ return this.intraline_status }-*/;
|
||||||
|
|
||||||
public final boolean has_skip() {
|
public final boolean hasSkip() {
|
||||||
JsArray<Region> c = content();
|
JsArray<Region> c = content();
|
||||||
for (int i = 0; i < c.length(); i++) {
|
for (int i = 0; i < c.length(); i++) {
|
||||||
if (c.get(i).skip() != 0) {
|
if (c.get(i).skip() != 0) {
|
||||||
@@ -88,7 +88,7 @@ public class DiffInfo extends JavaScriptObject {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String text_a() {
|
public final String textA() {
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
JsArray<Region> c = content();
|
JsArray<Region> c = content();
|
||||||
for (int i = 0; i < c.length(); i++) {
|
for (int i = 0; i < c.length(); i++) {
|
||||||
@@ -103,7 +103,7 @@ public class DiffInfo extends JavaScriptObject {
|
|||||||
return s.toString();
|
return s.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String text_b() {
|
public final String textB() {
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
JsArray<Region> c = content();
|
JsArray<Region> c = content();
|
||||||
for (int i = 0; i < c.length(); i++) {
|
for (int i = 0; i < c.length(); i++) {
|
||||||
@@ -133,9 +133,9 @@ public class DiffInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public static class FileMeta extends JavaScriptObject {
|
public static class FileMeta extends JavaScriptObject {
|
||||||
public final native String name() /*-{ return this.name; }-*/;
|
public final native String name() /*-{ return this.name; }-*/;
|
||||||
public final native String content_type() /*-{ return this.content_type; }-*/;
|
public final native String contentType() /*-{ return this.content_type; }-*/;
|
||||||
public final native int lines() /*-{ return this.lines || 0 }-*/;
|
public final native int lines() /*-{ return this.lines || 0 }-*/;
|
||||||
public final native JsArray<WebLinkInfo> web_links() /*-{ return this.web_links; }-*/;
|
public final native JsArray<WebLinkInfo> webLinks() /*-{ return this.web_links; }-*/;
|
||||||
|
|
||||||
protected FileMeta() {
|
protected FileMeta() {
|
||||||
}
|
}
|
||||||
@@ -148,8 +148,8 @@ public class DiffInfo extends JavaScriptObject {
|
|||||||
public final native int skip() /*-{ return this.skip || 0; }-*/;
|
public final native int skip() /*-{ return this.skip || 0; }-*/;
|
||||||
public final native boolean common() /*-{ return this.common || false; }-*/;
|
public final native boolean common() /*-{ return this.common || false; }-*/;
|
||||||
|
|
||||||
public final native JsArray<Span> edit_a() /*-{ return this.edit_a }-*/;
|
public final native JsArray<Span> editA() /*-{ return this.edit_a }-*/;
|
||||||
public final native JsArray<Span> edit_b() /*-{ return this.edit_b }-*/;
|
public final native JsArray<Span> editB() /*-{ return this.edit_b }-*/;
|
||||||
|
|
||||||
protected Region() {
|
protected Region() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,13 +151,13 @@ class DiffTable extends Composite {
|
|||||||
|
|
||||||
void set(DiffPreferences prefs, JsArray<RevisionInfo> list, DiffInfo info,
|
void set(DiffPreferences prefs, JsArray<RevisionInfo> list, DiffInfo info,
|
||||||
boolean editExists, int currentPatchSet, boolean open, boolean binary) {
|
boolean editExists, int currentPatchSet, boolean open, boolean binary) {
|
||||||
this.changeType = info.change_type();
|
this.changeType = info.changeType();
|
||||||
patchSetSelectBoxA.setUpPatchSetNav(list, info.meta_a(), editExists,
|
patchSetSelectBoxA.setUpPatchSetNav(list, info.metaA(), editExists,
|
||||||
currentPatchSet, open, binary);
|
currentPatchSet, open, binary);
|
||||||
patchSetSelectBoxB.setUpPatchSetNav(list, info.meta_b(), editExists,
|
patchSetSelectBoxB.setUpPatchSetNav(list, info.metaB(), editExists,
|
||||||
currentPatchSet, open, binary);
|
currentPatchSet, open, binary);
|
||||||
|
|
||||||
JsArrayString hdr = info.diff_header();
|
JsArrayString hdr = info.diffHeader();
|
||||||
if (hdr != null) {
|
if (hdr != null) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for (int i = 1; i < hdr.length(); i++) {
|
for (int i = 1; i < hdr.length(); i++) {
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ class DraftBox extends CommentBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void restoreSelection() {
|
private void restoreSelection() {
|
||||||
if (getFromTo() != null && comment.in_reply_to() == null) {
|
if (getFromTo() != null && comment.inReplyTo() == null) {
|
||||||
getCm().setSelection(getFromTo().from(), getFromTo().to());
|
getCm().setSelection(getFromTo().from(), getFromTo().to());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ import java.util.Comparator;
|
|||||||
|
|
||||||
public class FileInfo extends JavaScriptObject {
|
public class FileInfo extends JavaScriptObject {
|
||||||
public final native String path() /*-{ return this.path; }-*/;
|
public final native String path() /*-{ return this.path; }-*/;
|
||||||
public final native String old_path() /*-{ return this.old_path; }-*/;
|
public final native String oldPath() /*-{ return this.old_path; }-*/;
|
||||||
public final native int lines_inserted() /*-{ return this.lines_inserted || 0; }-*/;
|
public final native int linesInserted() /*-{ return this.lines_inserted || 0; }-*/;
|
||||||
public final native int lines_deleted() /*-{ return this.lines_deleted || 0; }-*/;
|
public final native int linesDeleted() /*-{ return this.lines_deleted || 0; }-*/;
|
||||||
public final native boolean binary() /*-{ return this.binary || false; }-*/;
|
public final native boolean binary() /*-{ return this.binary || false; }-*/;
|
||||||
public final native String status() /*-{ return this.status; }-*/;
|
public final native String status() /*-{ return this.status; }-*/;
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class PatchSetSelectBox extends Composite {
|
|||||||
linkPanel.add(createEditIcon());
|
linkPanel.add(createEditIcon());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<WebLinkInfo> webLinks = Natives.asList(meta.web_links());
|
List<WebLinkInfo> webLinks = Natives.asList(meta.webLinks());
|
||||||
if (webLinks != null) {
|
if (webLinks != null) {
|
||||||
for (WebLinkInfo webLink : webLinks) {
|
for (WebLinkInfo webLink : webLinks) {
|
||||||
linkPanel.add(webLink.toAnchor());
|
linkPanel.add(webLink.toAnchor());
|
||||||
|
|||||||
@@ -238,11 +238,11 @@ public class SideBySide extends Screen {
|
|||||||
changeStatus = info.status();
|
changeStatus = info.status();
|
||||||
info.revisions().copyKeysIntoChildren("name");
|
info.revisions().copyKeysIntoChildren("name");
|
||||||
if (edit != null) {
|
if (edit != null) {
|
||||||
edit.set_name(edit.commit().commit());
|
edit.setName(edit.commit().commit());
|
||||||
info.set_edit(edit);
|
info.setEdit(edit);
|
||||||
info.revisions().put(edit.name(), RevisionInfo.fromEdit(edit));
|
info.revisions().put(edit.name(), RevisionInfo.fromEdit(edit));
|
||||||
}
|
}
|
||||||
int currentPatchSet = info.revision(info.current_revision())._number();
|
int currentPatchSet = info.revision(info.currentRevision())._number();
|
||||||
JsArray<RevisionInfo> list = info.revisions().values();
|
JsArray<RevisionInfo> list = info.revisions().values();
|
||||||
RevisionInfo.sortRevisionInfoByNumber(list);
|
RevisionInfo.sortRevisionInfoByNumber(list);
|
||||||
diffTable.set(prefs, list, diff, edit != null, currentPatchSet,
|
diffTable.set(prefs, list, diff, edit != null, currentPatchSet,
|
||||||
@@ -570,8 +570,8 @@ public class SideBySide extends Screen {
|
|||||||
diffTable.addStyleName(DiffTable.style.showLineNumbers());
|
diffTable.addStyleName(DiffTable.style.showLineNumbers());
|
||||||
}
|
}
|
||||||
|
|
||||||
cmA = newCM(diff.meta_a(), diff.text_a(), diffTable.cmA);
|
cmA = newCM(diff.metaA(), diff.textA(), diffTable.cmA);
|
||||||
cmB = newCM(diff.meta_b(), diff.text_b(), diffTable.cmB);
|
cmB = newCM(diff.metaB(), diff.textB(), diffTable.cmB);
|
||||||
|
|
||||||
cmA.extras().side(DisplaySide.A);
|
cmA.extras().side(DisplaySide.A);
|
||||||
cmB.extras().side(DisplaySide.B);
|
cmB.extras().side(DisplaySide.B);
|
||||||
@@ -606,7 +606,7 @@ public class SideBySide extends Screen {
|
|||||||
chunkManager.getLineMapper());
|
chunkManager.getLineMapper());
|
||||||
|
|
||||||
prefsAction = new PreferencesAction(this, prefs);
|
prefsAction = new PreferencesAction(this, prefs);
|
||||||
header.init(prefsAction, getLinks(), diff.side_by_side_web_links());
|
header.init(prefsAction, getLinks(), diff.sideBySideWebLinks());
|
||||||
scrollSynchronizer.setAutoHideDiffTableHeader(prefs.autoHideDiffTableHeader());
|
scrollSynchronizer.setAutoHideDiffTableHeader(prefs.autoHideDiffTableHeader());
|
||||||
|
|
||||||
if (prefs.syntaxHighlighting() && fileSize.compareTo(FileSize.SMALL) > 0) {
|
if (prefs.syntaxHighlighting() && fileSize.compareTo(FileSize.SMALL) > 0) {
|
||||||
@@ -654,7 +654,7 @@ public class SideBySide extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DiffInfo.IntraLineStatus getIntraLineStatus() {
|
DiffInfo.IntraLineStatus getIntraLineStatus() {
|
||||||
return diff.intraline_status();
|
return diff.intralineStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canEnableRenderEntireFile(DiffPreferences prefs) {
|
boolean canEnableRenderEntireFile(DiffPreferences prefs) {
|
||||||
@@ -663,7 +663,7 @@ public class SideBySide extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getContentType() {
|
String getContentType() {
|
||||||
return getContentType(diff.meta_b());
|
return getContentType(diff.metaB());
|
||||||
}
|
}
|
||||||
|
|
||||||
void setThemeStyles(boolean d) {
|
void setThemeStyles(boolean d) {
|
||||||
@@ -716,8 +716,8 @@ public class SideBySide extends Screen {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
if (prefs.syntaxHighlighting()) {
|
if (prefs.syntaxHighlighting()) {
|
||||||
cmA.setOption("mode", getContentType(diff.meta_a()));
|
cmA.setOption("mode", getContentType(diff.metaA()));
|
||||||
cmB.setOption("mode", getContentType(diff.meta_b()));
|
cmB.setOption("mode", getContentType(diff.metaB()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -923,7 +923,7 @@ public class SideBySide extends Screen {
|
|||||||
int offset = 6;
|
int offset = 6;
|
||||||
|
|
||||||
// Adjust for merge commits, which have two parent lines
|
// Adjust for merge commits, which have two parent lines
|
||||||
if (diff.text_b().startsWith("Merge")) {
|
if (diff.textB().startsWith("Merge")) {
|
||||||
offset += 1;
|
offset += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -983,8 +983,8 @@ public class SideBySide extends Screen {
|
|||||||
|
|
||||||
private String getContentType(DiffInfo.FileMeta meta) {
|
private String getContentType(DiffInfo.FileMeta meta) {
|
||||||
if (prefs.syntaxHighlighting() && meta != null
|
if (prefs.syntaxHighlighting() && meta != null
|
||||||
&& meta.content_type() != null) {
|
&& meta.contentType() != null) {
|
||||||
ModeInfo m = ModeInfo.findMode(meta.content_type(), path);
|
ModeInfo m = ModeInfo.findMode(meta.contentType(), path);
|
||||||
return m != null ? m.mime() : null;
|
return m != null ? m.mime() : null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -992,8 +992,8 @@ public class SideBySide extends Screen {
|
|||||||
|
|
||||||
private void injectMode(DiffInfo diffInfo, AsyncCallback<Void> cb) {
|
private void injectMode(DiffInfo diffInfo, AsyncCallback<Void> cb) {
|
||||||
new ModeInjector()
|
new ModeInjector()
|
||||||
.add(getContentType(diffInfo.meta_a()))
|
.add(getContentType(diffInfo.metaA()))
|
||||||
.add(getContentType(diffInfo.meta_b()))
|
.add(getContentType(diffInfo.metaB()))
|
||||||
.inject(cb);
|
.inject(cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,8 +1043,8 @@ public class SideBySide extends Screen {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(DiffInfo info) {
|
public void onSuccess(DiffInfo info) {
|
||||||
new ModeInjector()
|
new ModeInjector()
|
||||||
.add(getContentType(info.meta_a()))
|
.add(getContentType(info.metaA()))
|
||||||
.add(getContentType(info.meta_b()))
|
.add(getContentType(info.metaB()))
|
||||||
.inject(CallbackGroup.<Void> emptyCallback());
|
.inject(CallbackGroup.<Void> emptyCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1085,8 +1085,8 @@ public class SideBySide extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static FileSize bucketFileSize(DiffInfo diff) {
|
private static FileSize bucketFileSize(DiffInfo diff) {
|
||||||
FileMeta a = diff.meta_a();
|
FileMeta a = diff.metaA();
|
||||||
FileMeta b = diff.meta_b();
|
FileMeta b = diff.metaB();
|
||||||
FileSize[] sizes = FileSize.values();
|
FileSize[] sizes = FileSize.values();
|
||||||
for (int i = sizes.length - 1; 0 <= i; i--) {
|
for (int i = sizes.length - 1; 0 <= i; i--) {
|
||||||
FileSize s = sizes[i];
|
FileSize s = sizes[i];
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import com.google.gwt.core.client.JavaScriptObject;
|
|||||||
import com.google.gwt.core.client.JsArray;
|
import com.google.gwt.core.client.JsArray;
|
||||||
|
|
||||||
public class EditFileInfo extends JavaScriptObject {
|
public class EditFileInfo extends JavaScriptObject {
|
||||||
public final native JsArray<DiffWebLinkInfo> web_links() /*-{ return this.web_links; }-*/;
|
public final native JsArray<DiffWebLinkInfo> webLinks() /*-{ return this.web_links; }-*/;
|
||||||
|
|
||||||
protected EditFileInfo() {
|
protected EditFileInfo() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ public class EditScreen extends Screen {
|
|||||||
.get(group1.add(new AsyncCallback<DiffInfo>() {
|
.get(group1.add(new AsyncCallback<DiffInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(DiffInfo diffInfo) {
|
public void onSuccess(DiffInfo diffInfo) {
|
||||||
diffLinks = diffInfo.web_links();
|
diffLinks = diffInfo.webLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -377,7 +377,7 @@ public class EditScreen extends Screen {
|
|||||||
renderLinksToDiff();
|
renderLinksToDiff();
|
||||||
|
|
||||||
if (editInfo != null) {
|
if (editInfo != null) {
|
||||||
renderLinks(Natives.asList(editInfo.web_links()));
|
renderLinks(Natives.asList(editInfo.webLinks()));
|
||||||
} else if (diffLinks != null) {
|
} else if (diffLinks != null) {
|
||||||
renderLinks(Natives.asList(diffLinks));
|
renderLinks(Natives.asList(diffLinks));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class GroupApi {
|
|||||||
} else {
|
} else {
|
||||||
MemberInput input = MemberInput.create();
|
MemberInput input = MemberInput.create();
|
||||||
for (String member : members) {
|
for (String member : members) {
|
||||||
input.add_member(member);
|
input.addMember(member);
|
||||||
}
|
}
|
||||||
members(group).post(input, cb);
|
members(group).post(input, cb);
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ public class GroupApi {
|
|||||||
} else {
|
} else {
|
||||||
MemberInput in = MemberInput.create();
|
MemberInput in = MemberInput.create();
|
||||||
for (Integer id : ids) {
|
for (Integer id : ids) {
|
||||||
in.add_member(id.toString());
|
in.addMember(id.toString());
|
||||||
}
|
}
|
||||||
group(group).view("members.delete").post(in, cb);
|
group(group).view("members.delete").post(in, cb);
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ public class GroupApi {
|
|||||||
} else {
|
} else {
|
||||||
IncludedGroupInput input = IncludedGroupInput.create();
|
IncludedGroupInput input = IncludedGroupInput.create();
|
||||||
for (String includedGroup : includedGroups) {
|
for (String includedGroup : includedGroups) {
|
||||||
input.add_group(includedGroup);
|
input.addGroup(includedGroup);
|
||||||
}
|
}
|
||||||
groups(group).post(input, cb);
|
groups(group).post(input, cb);
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ public class GroupApi {
|
|||||||
} else {
|
} else {
|
||||||
IncludedGroupInput in = IncludedGroupInput.create();
|
IncludedGroupInput in = IncludedGroupInput.create();
|
||||||
for (AccountGroup.UUID g : ids) {
|
for (AccountGroup.UUID g : ids) {
|
||||||
in.add_group(g.get());
|
in.addGroup(g.get());
|
||||||
}
|
}
|
||||||
group(group).view("groups.delete").post(in, cb);
|
group(group).view("groups.delete").post(in, cb);
|
||||||
}
|
}
|
||||||
@@ -235,7 +235,7 @@ public class GroupApi {
|
|||||||
|
|
||||||
private static class MemberInput extends JavaScriptObject {
|
private static class MemberInput extends JavaScriptObject {
|
||||||
final native void init() /*-{ this.members = []; }-*/;
|
final native void init() /*-{ this.members = []; }-*/;
|
||||||
final native void add_member(String n) /*-{ this.members.push(n); }-*/;
|
final native void addMember(String n) /*-{ this.members.push(n); }-*/;
|
||||||
|
|
||||||
static MemberInput create() {
|
static MemberInput create() {
|
||||||
MemberInput m = (MemberInput) createObject();
|
MemberInput m = (MemberInput) createObject();
|
||||||
@@ -249,7 +249,7 @@ public class GroupApi {
|
|||||||
|
|
||||||
private static class IncludedGroupInput extends JavaScriptObject {
|
private static class IncludedGroupInput extends JavaScriptObject {
|
||||||
final native void init() /*-{ this.groups = []; }-*/;
|
final native void init() /*-{ this.groups = []; }-*/;
|
||||||
final native void add_group(String n) /*-{ this.groups.push(n); }-*/;
|
final native void addGroup(String n) /*-{ this.groups.push(n); }-*/;
|
||||||
|
|
||||||
static IncludedGroupInput create() {
|
static IncludedGroupInput create() {
|
||||||
IncludedGroupInput g = (IncludedGroupInput) createObject();
|
IncludedGroupInput g = (IncludedGroupInput) createObject();
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
|
|||||||
if (c.getLine() > 0) {
|
if (c.getLine() > 0) {
|
||||||
i.line(c.getLine());
|
i.line(c.getLine());
|
||||||
}
|
}
|
||||||
i.in_reply_to(c.getParentUuid());
|
i.inReplyTo(c.getParentUuid());
|
||||||
i.message(c.getMessage());
|
i.message(c.getMessage());
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -359,7 +359,7 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
|
|||||||
i.id()),
|
i.id()),
|
||||||
i.line(),
|
i.line(),
|
||||||
Gerrit.getUserAccount().getId(),
|
Gerrit.getUserAccount().getId(),
|
||||||
i.in_reply_to(),
|
i.inReplyTo(),
|
||||||
i.updated());
|
i.updated());
|
||||||
p.setMessage(i.message());
|
p.setMessage(i.message());
|
||||||
p.setSide((short) (i.side() == Side.PARENT ? 0 : 1));
|
p.setSide((short) (i.side() == Side.PARENT ? 0 : 1));
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ public class UnifiedPatchScreen extends Screen implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<WebLinkInfo> getWebLinks(DiffInfo diffInfo) {
|
private List<WebLinkInfo> getWebLinks(DiffInfo diffInfo) {
|
||||||
return diffInfo.unified_web_links();
|
return diffInfo.unifiedWebLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSideBySideDiffUrl() {
|
private String getSideBySideDiffUrl() {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class BranchInfo extends JavaScriptObject {
|
|||||||
public final native String revision() /*-{ return this.revision; }-*/;
|
public final native String revision() /*-{ return this.revision; }-*/;
|
||||||
public final native boolean canDelete() /*-{ return this['can_delete'] ? true : false; }-*/;
|
public final native boolean canDelete() /*-{ return this['can_delete'] ? true : false; }-*/;
|
||||||
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions }-*/;
|
public final native NativeMap<ActionInfo> actions() /*-{ return this.actions }-*/;
|
||||||
public final native JsArray<WebLinkInfo> web_links() /*-{ return this.web_links; }-*/;
|
public final native JsArray<WebLinkInfo> webLinks() /*-{ return this.web_links; }-*/;
|
||||||
|
|
||||||
protected BranchInfo() {
|
protected BranchInfo() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,23 +35,23 @@ public class ConfigInfo extends JavaScriptObject {
|
|||||||
public final native String description()
|
public final native String description()
|
||||||
/*-{ return this.description }-*/;
|
/*-{ return this.description }-*/;
|
||||||
|
|
||||||
public final native InheritedBooleanInfo require_change_id()
|
public final native InheritedBooleanInfo requireChangeId()
|
||||||
/*-{ return this.require_change_id; }-*/;
|
/*-{ return this.require_change_id; }-*/;
|
||||||
|
|
||||||
public final native InheritedBooleanInfo use_content_merge()
|
public final native InheritedBooleanInfo useContentMerge()
|
||||||
/*-{ return this.use_content_merge; }-*/;
|
/*-{ return this.use_content_merge; }-*/;
|
||||||
|
|
||||||
public final native InheritedBooleanInfo use_contributor_agreements()
|
public final native InheritedBooleanInfo useContributorAgreements()
|
||||||
/*-{ return this.use_contributor_agreements; }-*/;
|
/*-{ return this.use_contributor_agreements; }-*/;
|
||||||
|
|
||||||
public final native InheritedBooleanInfo create_new_change_for_all_not_in_target()
|
public final native InheritedBooleanInfo createNewChangeForAllNotInTarget()
|
||||||
/*-{ return this.create_new_change_for_all_not_in_target; }-*/;
|
/*-{ return this.create_new_change_for_all_not_in_target; }-*/;
|
||||||
|
|
||||||
public final native InheritedBooleanInfo use_signed_off_by()
|
public final native InheritedBooleanInfo useSignedOffBy()
|
||||||
/*-{ return this.use_signed_off_by; }-*/;
|
/*-{ return this.use_signed_off_by; }-*/;
|
||||||
|
|
||||||
public final SubmitType submit_type() {
|
public final SubmitType submitType() {
|
||||||
return SubmitType.valueOf(submit_typeRaw());
|
return SubmitType.valueOf(submitTypeRaw());
|
||||||
}
|
}
|
||||||
|
|
||||||
public final native NativeMap<NativeMap<ConfigParameterInfo>> pluginConfig()
|
public final native NativeMap<NativeMap<ConfigParameterInfo>> pluginConfig()
|
||||||
@@ -63,7 +63,7 @@ public class ConfigInfo extends JavaScriptObject {
|
|||||||
public final native NativeMap<ActionInfo> actions()
|
public final native NativeMap<ActionInfo> actions()
|
||||||
/*-{ return this.actions; }-*/;
|
/*-{ return this.actions; }-*/;
|
||||||
|
|
||||||
private final native String submit_typeRaw()
|
private final native String submitTypeRaw()
|
||||||
/*-{ return this.submit_type }-*/;
|
/*-{ return this.submit_type }-*/;
|
||||||
|
|
||||||
public final ProjectState state() {
|
public final ProjectState state() {
|
||||||
@@ -75,7 +75,7 @@ public class ConfigInfo extends JavaScriptObject {
|
|||||||
private final native String stateRaw()
|
private final native String stateRaw()
|
||||||
/*-{ return this.state }-*/;
|
/*-{ return this.state }-*/;
|
||||||
|
|
||||||
public final native MaxObjectSizeLimitInfo max_object_size_limit()
|
public final native MaxObjectSizeLimitInfo maxObjectSizeLimit()
|
||||||
/*-{ return this.max_object_size_limit; }-*/;
|
/*-{ return this.max_object_size_limit; }-*/;
|
||||||
|
|
||||||
private final native NativeMap<CommentLinkInfo> commentlinks0()
|
private final native NativeMap<CommentLinkInfo> commentlinks0()
|
||||||
@@ -131,13 +131,13 @@ public class ConfigInfo extends JavaScriptObject {
|
|||||||
public final native boolean value()
|
public final native boolean value()
|
||||||
/*-{ return this.value ? true : false; }-*/;
|
/*-{ return this.value ? true : false; }-*/;
|
||||||
|
|
||||||
public final native boolean inherited_value()
|
public final native boolean inheritedValue()
|
||||||
/*-{ return this.inherited_value ? true : false; }-*/;
|
/*-{ return this.inherited_value ? true : false; }-*/;
|
||||||
|
|
||||||
public final InheritableBoolean configured_value() {
|
public final InheritableBoolean configuredValue() {
|
||||||
return InheritableBoolean.valueOf(configured_valueRaw());
|
return InheritableBoolean.valueOf(configuredValueRaw());
|
||||||
}
|
}
|
||||||
private final native String configured_valueRaw()
|
private final native String configuredValueRaw()
|
||||||
/*-{ return this.configured_value }-*/;
|
/*-{ return this.configured_value }-*/;
|
||||||
|
|
||||||
public final void setConfiguredValue(InheritableBoolean v) {
|
public final void setConfiguredValue(InheritableBoolean v) {
|
||||||
@@ -152,8 +152,8 @@ public class ConfigInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public static class MaxObjectSizeLimitInfo extends JavaScriptObject {
|
public static class MaxObjectSizeLimitInfo extends JavaScriptObject {
|
||||||
public final native String value() /*-{ return this.value; }-*/;
|
public final native String value() /*-{ return this.value; }-*/;
|
||||||
public final native String inherited_value() /*-{ return this.inherited_value; }-*/;
|
public final native String inheritedValue() /*-{ return this.inherited_value; }-*/;
|
||||||
public final native String configured_value() /*-{ return this.configured_value }-*/;
|
public final native String configuredValue() /*-{ return this.configured_value }-*/;
|
||||||
|
|
||||||
protected MaxObjectSizeLimitInfo() {
|
protected MaxObjectSizeLimitInfo() {
|
||||||
}
|
}
|
||||||
@@ -179,8 +179,8 @@ public class ConfigInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public static class ConfigParameterValue extends JavaScriptObject {
|
public static class ConfigParameterValue extends JavaScriptObject {
|
||||||
final native void init() /*-{ this.values = []; }-*/;
|
final native void init() /*-{ this.values = []; }-*/;
|
||||||
final native void add_value(String v) /*-{ this.values.push(v); }-*/;
|
final native void addValue(String v) /*-{ this.values.push(v); }-*/;
|
||||||
final native void set_value(String v) /*-{ if(v)this.value = v; }-*/;
|
final native void setValue(String v) /*-{ if(v)this.value = v; }-*/;
|
||||||
public static ConfigParameterValue create() {
|
public static ConfigParameterValue create() {
|
||||||
ConfigParameterValue v = createObject().cast();
|
ConfigParameterValue v = createObject().cast();
|
||||||
return v;
|
return v;
|
||||||
@@ -189,13 +189,13 @@ public class ConfigInfo extends JavaScriptObject {
|
|||||||
public final ConfigParameterValue values(String[] values) {
|
public final ConfigParameterValue values(String[] values) {
|
||||||
init();
|
init();
|
||||||
for (String v : values) {
|
for (String v : values) {
|
||||||
add_value(v);
|
addValue(v);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final ConfigParameterValue value(String v) {
|
public final ConfigParameterValue value(String v) {
|
||||||
set_value(v);
|
setValue(v);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class ConfigInfoCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void add(ChangeInfo info) {
|
public static void add(ChangeInfo info) {
|
||||||
instance.changeToProject.put(info.legacy_id().get(), info.project());
|
instance.changeToProject.put(info.legacyId().get(), info.project());
|
||||||
}
|
}
|
||||||
|
|
||||||
private final LinkedHashMap<String, Entry> cache;
|
private final LinkedHashMap<String, Entry> cache;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class ProjectApi {
|
|||||||
} else {
|
} else {
|
||||||
DeleteBranchesInput d = DeleteBranchesInput.create();
|
DeleteBranchesInput d = DeleteBranchesInput.create();
|
||||||
for (String ref : refs) {
|
for (String ref : refs) {
|
||||||
d.add_branch(ref);
|
d.addBranch(ref);
|
||||||
}
|
}
|
||||||
project(name).view("branches:delete").post(d, cb);
|
project(name).view("branches:delete").post(d, cb);
|
||||||
}
|
}
|
||||||
@@ -317,6 +317,6 @@ public class ProjectApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final native void init() /*-{ this.branches = []; }-*/;
|
final native void init() /*-{ this.branches = []; }-*/;
|
||||||
final native void add_branch(String b) /*-{ this.branches.push(b); }-*/;
|
final native void addBranch(String b) /*-{ this.branches.push(b); }-*/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ProjectInfo
|
|||||||
|
|
||||||
public final native String name() /*-{ return this.name; }-*/;
|
public final native String name() /*-{ return this.name; }-*/;
|
||||||
public final native String description() /*-{ return this.description; }-*/;
|
public final native String description() /*-{ return this.description; }-*/;
|
||||||
public final native JsArray<WebLinkInfo> web_links() /*-{ return this.web_links; }-*/;
|
public final native JsArray<WebLinkInfo> webLinks() /*-{ return this.web_links; }-*/;
|
||||||
|
|
||||||
public final ProjectState state() {
|
public final ProjectState state() {
|
||||||
return ProjectState.valueOf(getStringState());
|
return ProjectState.valueOf(getStringState());
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ public class AccountLinkPanel extends FlowPanel {
|
|||||||
return ai.email();
|
return ai.email();
|
||||||
} else if (ai.name() != null) {
|
} else if (ai.name() != null) {
|
||||||
return ai.name();
|
return ai.name();
|
||||||
} else if (ai._account_id() != 0) {
|
} else if (ai._accountId() != 0) {
|
||||||
return "" + ai._account_id();
|
return "" + ai._accountId();
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ public abstract class RebaseDialog extends CommentedActionDialog {
|
|||||||
String query = request.getQuery().toLowerCase();
|
String query = request.getQuery().toLowerCase();
|
||||||
LinkedList<ChangeSuggestion> suggestions = new LinkedList<>();
|
LinkedList<ChangeSuggestion> suggestions = new LinkedList<>();
|
||||||
for (final ChangeInfo ci : changes) {
|
for (final ChangeInfo ci : changes) {
|
||||||
if (changeId.equals(ci.legacy_id())) {
|
if (changeId.equals(ci.legacyId())) {
|
||||||
continue; // do not suggest current change
|
continue; // do not suggest current change
|
||||||
}
|
}
|
||||||
String id = String.valueOf(ci.legacy_id().get());
|
String id = String.valueOf(ci.legacyId().get());
|
||||||
if (id.contains(query) || ci.subject().toLowerCase().contains(query)) {
|
if (id.contains(query) || ci.subject().toLowerCase().contains(query)) {
|
||||||
suggestions.add(new ChangeSuggestion(ci));
|
suggestions.add(new ChangeSuggestion(ci));
|
||||||
if (suggestions.size() >= 50) { // limit to 50 suggestions
|
if (suggestions.size() >= 50) { // limit to 50 suggestions
|
||||||
@@ -136,12 +136,12 @@ public abstract class RebaseDialog extends CommentedActionDialog {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayString() {
|
public String getDisplayString() {
|
||||||
return String.valueOf(change.legacy_id().get()) + ": " + change.subject();
|
return String.valueOf(change.legacyId().get()) + ": " + change.subject();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getReplacementString() {
|
public String getReplacementString() {
|
||||||
return String.valueOf(change.legacy_id().get());
|
return String.valueOf(change.legacyId().get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ public class TextMarker extends JavaScriptObject {
|
|||||||
|
|
||||||
public static FromTo create(CommentRange range) {
|
public static FromTo create(CommentRange range) {
|
||||||
return create(
|
return create(
|
||||||
Pos.create(range.start_line() - 1, range.start_character()),
|
Pos.create(range.startLine() - 1, range.startCharacter()),
|
||||||
Pos.create(range.end_line() - 1, range.end_character()));
|
Pos.create(range.endLine() - 1, range.endCharacter()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final native Pos from() /*-{ return this.from }-*/;
|
public final native Pos from() /*-{ return this.from }-*/;
|
||||||
|
|||||||
Reference in New Issue
Block a user