class BranchManagementPresenter extends Section<ProjectScreenModel> {

    @Override
    public Promise<Void> setup(final ProjectScreenModel model) {
        return projectController.getUpdatableBranches(libraryPlaces.getActiveWorkspace()).then(branches -> {
            view.init(this);

            if (branches.isEmpty()) {
                view.showEmptyState();
                return promises.resolve();
            }

            selectedBranch = libraryPlaces.getActiveWorkspace().getBranch().getName();

            view.setupBranchSelect(branches.stream().map(Branch::getName).sorted(String::compareToIgnoreCase).map(p -> new KieSelectOption(p, p)).collect(toList()),
                                 selectedBranch,
                                 this::setBranch);

            return setup(libraryPlaces.getActiveWorkspace().getBranch().getName());
        });
    }

    @Inject public  BranchManagementPresenter(final View view,
                                     final Promises promises,
                                     final MenuItem<ProjectScreenModel> menuItem,
                                     final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                     final Caller<LibraryService> libraryService,
                                     final LibraryPlaces libraryPlaces,
                                     final RoleAccessListPresenter roleAccessListPresenter,
                                     final ProjectController projectController);

}