Merge "SubmittedTogether: Only show tab if there is more than one change"
This commit is contained in:
@@ -32,6 +32,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
@@ -60,12 +61,16 @@ public class SubmittedTogether implements RestReadView<ChangeResource> {
|
||||
try {
|
||||
ChangeSet cs = mergeSuperSet.completeChangeSet(dbProvider.get(),
|
||||
ChangeSet.create(resource.getChange()));
|
||||
return json.create(EnumSet.of(
|
||||
ListChangesOption.CURRENT_REVISION,
|
||||
ListChangesOption.CURRENT_COMMIT,
|
||||
ListChangesOption.DETAILED_LABELS,
|
||||
ListChangesOption.LABELS))
|
||||
.format(cs.ids());
|
||||
if (cs.ids().size() > 1) {
|
||||
return json.create(EnumSet.of(
|
||||
ListChangesOption.CURRENT_REVISION,
|
||||
ListChangesOption.CURRENT_COMMIT,
|
||||
ListChangesOption.DETAILED_LABELS,
|
||||
ListChangesOption.LABELS))
|
||||
.format(cs.ids());
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
} catch (OrmException | IOException e) {
|
||||
log.error("Error on getting a ChangeSet", e);
|
||||
throw e;
|
||||
|
Reference in New Issue
Block a user