use of com.google.gerrit.extensions.client.ProjectState in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method initProjectOptions.
private void initProjectOptions() {
grid.addHeader(new SmallHeading(AdminConstants.I.headingProjectOptions()));
state = new ListBox();
for (ProjectState stateValue : ProjectState.values()) {
state.addItem(Util.toLongString(stateValue), stateValue.name());
}
saveEnabler.listenTo(state);
grid.add(AdminConstants.I.headingProjectState(), state);
submitType = new ListBox();
for (final SubmitType type : SubmitType.values()) {
submitType.addItem(Util.toLongString(type), type.name());
}
submitType.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
setEnabledForUseContentMerge();
}
});
saveEnabler.listenTo(submitType);
grid.add(AdminConstants.I.headingProjectSubmitType(), submitType);
contentMerge = newInheritedBooleanBox();
saveEnabler.listenTo(contentMerge);
grid.add(AdminConstants.I.useContentMerge(), contentMerge);
newChangeForAllNotInTarget = newInheritedBooleanBox();
saveEnabler.listenTo(newChangeForAllNotInTarget);
grid.add(AdminConstants.I.createNewChangeForAllNotInTarget(), newChangeForAllNotInTarget);
requireChangeID = newInheritedBooleanBox();
saveEnabler.listenTo(requireChangeID);
grid.addHtml(AdminConstants.I.requireChangeID(), requireChangeID);
if (Gerrit.info().receive().enableSignedPush()) {
enableSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(enableSignedPush);
grid.add(AdminConstants.I.enableSignedPush(), enableSignedPush);
requireSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(requireSignedPush);
grid.add(AdminConstants.I.requireSignedPush(), requireSignedPush);
}
rejectImplicitMerges = newInheritedBooleanBox();
saveEnabler.listenTo(rejectImplicitMerges);
grid.addHtml(AdminConstants.I.rejectImplicitMerges(), rejectImplicitMerges);
enableReviewerByEmail = newInheritedBooleanBox();
saveEnabler.listenTo(enableReviewerByEmail);
grid.addHtml(AdminConstants.I.enableReviewerByEmail(), enableReviewerByEmail);
maxObjectSizeLimit = new NpTextBox();
saveEnabler.listenTo(maxObjectSizeLimit);
effectiveMaxObjectSizeLimit = new Label();
effectiveMaxObjectSizeLimit.setStyleName(Gerrit.RESOURCES.css().maxObjectSizeLimitEffectiveLabel());
HorizontalPanel p = new HorizontalPanel();
p.add(maxObjectSizeLimit);
p.add(effectiveMaxObjectSizeLimit);
grid.addHtml(AdminConstants.I.headingMaxObjectSizeLimit(), p);
}
use of com.google.gerrit.extensions.client.ProjectState in project gerrit by GerritCodeReview.
the class ProjectIT method nonActiveProjectCanBeMadeActive.
@Test
public void nonActiveProjectCanBeMadeActive() throws Exception {
for (ProjectState nonActiveState : ImmutableList.of(ProjectState.READ_ONLY, ProjectState.HIDDEN)) {
// ACTIVE => NON_ACTIVE
ConfigInput ci1 = new ConfigInput();
ci1.state = nonActiveState;
gApi.projects().name(project.get()).config(ci1);
assertThat(gApi.projects().name(project.get()).config().state).isEqualTo(nonActiveState);
// NON_ACTIVE => ACTIVE
ConfigInput ci2 = new ConfigInput();
ci2.state = ProjectState.ACTIVE;
gApi.projects().name(project.get()).config(ci2);
// ACTIVE is represented as null in the API
assertThat(gApi.projects().name(project.get()).config().state).isNull();
}
}
Aggregations