Merge "Rename 'is_visible_to_all' in GroupOptionsInfo to 'visible_to_all'"

This commit is contained in:
Edwin Kempin 2013-02-05 14:26:43 +00:00 committed by Gerrit Code Review
commit 70f4853152
6 changed files with 16 additions and 16 deletions

View File

@ -269,12 +269,12 @@ GroupOptionsInfo
Options of the group.
[options="header",width="50%",cols="1,^1,5"]
|================================
|Field Name ||Description
|`kind` ||`gerritcodereview#groupoptions`
|`is_visible_to_all`|not set if `false`|
|=============================
|Field Name ||Description
|`kind` ||`gerritcodereview#groupoptions`
|`visible_to_all`|not set if `false`|
Whether the group is visible to all registered users.
|================================
|=============================
[[member-info]]
MemberInfo

View File

@ -68,7 +68,7 @@ public class GroupApi {
public static void setGroupOptions(AccountGroup.UUID group,
boolean isVisibleToAll, AsyncCallback<VoidResult> cb) {
GroupOptionsInput in = GroupOptionsInput.create();
in.isVisibleToAll(isVisibleToAll);
in.visibleToAll(isVisibleToAll);
group(group).view("options").put(in, cb);
}
@ -194,7 +194,7 @@ public class GroupApi {
}
private static class GroupOptionsInput extends JavaScriptObject {
final native void isVisibleToAll(boolean v) /*-{ if(v)this.is_visible_to_all=v; }-*/;
final native void visibleToAll(boolean v) /*-{ if(v)this.visible_to_all=v; }-*/;
static GroupOptionsInput create() {
return (GroupOptionsInput) createObject();

View File

@ -48,7 +48,7 @@ public class GroupInfo extends JavaScriptObject {
}
public static class GroupOptionsInfo extends JavaScriptObject {
public final native boolean isVisibleToAll() /*-{ return this['is_visible_to_all'] ? true : false; }-*/;
public final native boolean isVisibleToAll() /*-{ return this['visible_to_all'] ? true : false; }-*/;
protected GroupOptionsInfo() {
}

View File

@ -19,13 +19,13 @@ import com.google.gerrit.reviewdb.client.AccountGroup;
public class GroupOptionsInfo {
final String kind = "gerritcodereview#groupoptions";
public Boolean isVisibleToAll;
public Boolean visibleToAll;
public GroupOptionsInfo(GroupDescription.Basic group) {
isVisibleToAll = group.isVisibleToAll() ? true : null;
visibleToAll = group.isVisibleToAll() ? true : null;
}
public GroupOptionsInfo(AccountGroup group) {
isVisibleToAll = group.isVisibleToAll() ? true : null;
visibleToAll = group.isVisibleToAll() ? true : null;
}
}

View File

@ -30,7 +30,7 @@ import java.util.Collections;
public class PutOptions implements RestModifyView<GroupResource, Input> {
static class Input {
Boolean isVisibleToAll;
Boolean visibleToAll;
}
private final GroupCache groupCache;
@ -55,8 +55,8 @@ public class PutOptions implements RestModifyView<GroupResource, Input> {
if (input == null) {
throw new BadRequestException("options are required");
}
if (input.isVisibleToAll == null) {
input.isVisibleToAll = false;
if (input.visibleToAll == null) {
input.visibleToAll = false;
}
AccountGroup group = db.accountGroups().get(
@ -65,7 +65,7 @@ public class PutOptions implements RestModifyView<GroupResource, Input> {
throw new ResourceNotFoundException();
}
group.setVisibleToAll(input.isVisibleToAll);
group.setVisibleToAll(input.visibleToAll);
db.accountGroups().update(Collections.singleton(group));
groupCache.evict(group);

View File

@ -89,7 +89,7 @@ public class ListGroupsCommand extends BaseCommand {
formatter.addColumn(o != null ? o.getName() : "n/a");
formatter.addColumn(o != null ? o.getGroupUUID().get() : "");
formatter.addColumn(Boolean.toString(Objects.firstNonNull(
info.options.isVisibleToAll, Boolean.FALSE)));
info.options.visibleToAll, Boolean.FALSE)));
}
formatter.nextLine();
}