Filter out core UiCommands from legacy PatchSet view
Don't send any core commands to the legacy patch set view. These are currently handled in a different API and UI display code, most of which I am trying to rewrite and delete. Assume for now that there will be no new interesting core commands while we switch the view. Change-Id: If129a413d673ac1eb20981f0e25a0c9382e71ff9
This commit is contained in:
parent
9b4b36a458
commit
7e90035c09
@ -173,10 +173,10 @@ class PatchSetDetailFactory extends Handler<PatchSetDetail> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
detail.setCommands(UiCommands.sorted(UiCommands.from(
|
detail.setCommands(UiCommands.sorted(UiCommands.plugins(UiCommands.from(
|
||||||
revisions,
|
revisions,
|
||||||
new RevisionResource(new ChangeResource(control), patchSet),
|
new RevisionResource(new ChangeResource(control), patchSet),
|
||||||
EnumSet.of(UiCommand.Place.PATCHSET_ACTION_PANEL))));
|
EnumSet.of(UiCommand.Place.PATCHSET_ACTION_PANEL)))));
|
||||||
return detail;
|
return detail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,16 @@ public class UiCommands {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Iterable<UiCommandDetail> plugins(Iterable<UiCommandDetail> in) {
|
||||||
|
return Iterables.filter(in,
|
||||||
|
new Predicate<UiCommandDetail>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(UiCommandDetail input) {
|
||||||
|
return input.id.indexOf('~') > 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static <R extends RestResource> Iterable<UiCommandDetail> from(
|
public static <R extends RestResource> Iterable<UiCommandDetail> from(
|
||||||
ChildCollection<?, R> collection,
|
ChildCollection<?, R> collection,
|
||||||
R resource,
|
R resource,
|
||||||
|
Loading…
Reference in New Issue
Block a user