Rename 'is_visible_to_all' in GroupOptionsInfo to 'visible_to_all'
In the input for creating a new group this field is named 'visible_to_all'. Change the name of the field in GroupOptionsInfo to be consistent. Change-Id: I7689b734dad256b6db98d246948ce507c5486e92 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -269,12 +269,12 @@ GroupOptionsInfo
|
|||||||
Options of the group.
|
Options of the group.
|
||||||
|
|
||||||
[options="header",width="50%",cols="1,^1,5"]
|
[options="header",width="50%",cols="1,^1,5"]
|
||||||
|================================
|
|=============================
|
||||||
|Field Name ||Description
|
|Field Name ||Description
|
||||||
|`kind` ||`gerritcodereview#groupoptions`
|
|`kind` ||`gerritcodereview#groupoptions`
|
||||||
|`is_visible_to_all`|not set if `false`|
|
|`visible_to_all`|not set if `false`|
|
||||||
Whether the group is visible to all registered users.
|
Whether the group is visible to all registered users.
|
||||||
|================================
|
|=============================
|
||||||
|
|
||||||
[[member-info]]
|
[[member-info]]
|
||||||
MemberInfo
|
MemberInfo
|
||||||
|
@@ -68,7 +68,7 @@ public class GroupApi {
|
|||||||
public static void setGroupOptions(AccountGroup.UUID group,
|
public static void setGroupOptions(AccountGroup.UUID group,
|
||||||
boolean isVisibleToAll, AsyncCallback<VoidResult> cb) {
|
boolean isVisibleToAll, AsyncCallback<VoidResult> cb) {
|
||||||
GroupOptionsInput in = GroupOptionsInput.create();
|
GroupOptionsInput in = GroupOptionsInput.create();
|
||||||
in.isVisibleToAll(isVisibleToAll);
|
in.visibleToAll(isVisibleToAll);
|
||||||
group(group).view("options").put(in, cb);
|
group(group).view("options").put(in, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ public class GroupApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class GroupOptionsInput extends JavaScriptObject {
|
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() {
|
static GroupOptionsInput create() {
|
||||||
return (GroupOptionsInput) createObject();
|
return (GroupOptionsInput) createObject();
|
||||||
|
@@ -48,7 +48,7 @@ public class GroupInfo extends JavaScriptObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class GroupOptionsInfo 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() {
|
protected GroupOptionsInfo() {
|
||||||
}
|
}
|
||||||
|
@@ -19,13 +19,13 @@ import com.google.gerrit.reviewdb.client.AccountGroup;
|
|||||||
|
|
||||||
public class GroupOptionsInfo {
|
public class GroupOptionsInfo {
|
||||||
final String kind = "gerritcodereview#groupoptions";
|
final String kind = "gerritcodereview#groupoptions";
|
||||||
public Boolean isVisibleToAll;
|
public Boolean visibleToAll;
|
||||||
|
|
||||||
public GroupOptionsInfo(GroupDescription.Basic group) {
|
public GroupOptionsInfo(GroupDescription.Basic group) {
|
||||||
isVisibleToAll = group.isVisibleToAll() ? true : null;
|
visibleToAll = group.isVisibleToAll() ? true : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GroupOptionsInfo(AccountGroup group) {
|
public GroupOptionsInfo(AccountGroup group) {
|
||||||
isVisibleToAll = group.isVisibleToAll() ? true : null;
|
visibleToAll = group.isVisibleToAll() ? true : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ import java.util.Collections;
|
|||||||
|
|
||||||
public class PutOptions implements RestModifyView<GroupResource, Input> {
|
public class PutOptions implements RestModifyView<GroupResource, Input> {
|
||||||
static class Input {
|
static class Input {
|
||||||
Boolean isVisibleToAll;
|
Boolean visibleToAll;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final GroupCache groupCache;
|
private final GroupCache groupCache;
|
||||||
@@ -55,8 +55,8 @@ public class PutOptions implements RestModifyView<GroupResource, Input> {
|
|||||||
if (input == null) {
|
if (input == null) {
|
||||||
throw new BadRequestException("options are required");
|
throw new BadRequestException("options are required");
|
||||||
}
|
}
|
||||||
if (input.isVisibleToAll == null) {
|
if (input.visibleToAll == null) {
|
||||||
input.isVisibleToAll = false;
|
input.visibleToAll = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountGroup group = db.accountGroups().get(
|
AccountGroup group = db.accountGroups().get(
|
||||||
@@ -65,7 +65,7 @@ public class PutOptions implements RestModifyView<GroupResource, Input> {
|
|||||||
throw new ResourceNotFoundException();
|
throw new ResourceNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
group.setVisibleToAll(input.isVisibleToAll);
|
group.setVisibleToAll(input.visibleToAll);
|
||||||
db.accountGroups().update(Collections.singleton(group));
|
db.accountGroups().update(Collections.singleton(group));
|
||||||
groupCache.evict(group);
|
groupCache.evict(group);
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ public class ListGroupsCommand extends BaseCommand {
|
|||||||
formatter.addColumn(o != null ? o.getName() : "n/a");
|
formatter.addColumn(o != null ? o.getName() : "n/a");
|
||||||
formatter.addColumn(o != null ? o.getGroupUUID().get() : "");
|
formatter.addColumn(o != null ? o.getGroupUUID().get() : "");
|
||||||
formatter.addColumn(Boolean.toString(Objects.firstNonNull(
|
formatter.addColumn(Boolean.toString(Objects.firstNonNull(
|
||||||
info.options.isVisibleToAll, Boolean.FALSE)));
|
info.options.visibleToAll, Boolean.FALSE)));
|
||||||
}
|
}
|
||||||
formatter.nextLine();
|
formatter.nextLine();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user