Skip to content

Commit

Permalink
Remove old promotion manager
Browse files Browse the repository at this point in the history
  • Loading branch information
forgottosave committed Nov 2, 2024
1 parent c97f4cc commit 93e0c71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
21 changes: 1 addition & 20 deletions src/core/OSTreeTUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,27 +100,8 @@ int OSTreeTUI::main(const std::string& repo, const std::vector<std::string>& sta
return filterManager.branchBoxRender();
});

// promotion
ContentPromotionManager promotionManager(showTooltips);
promotionManager.setBranchRadiobox(Radiobox(&allBranches, &promotionManager.selectedBranch));
promotionManager.setApplyButton(Button(" Apply ", [&] {
ostreeRepo.promoteCommit(visibleCommitViewMap.at(selectedCommit),
ostreeRepo.getBranches().at(static_cast<size_t>(promotionManager.selectedBranch)),
{}, promotionManager.newSubject,
true);
//refresh_repository();
notificationText = " Applied content promotion. ";
}, ButtonOption::Simple()));
Component promotionView = Renderer(promotionManager.composePromotionComponent(), [&] {
if (visibleCommitViewMap.size() <= 0) {
return text(" please select a commit to continue commit-promotion... ") | color(Color::RedLight) | bold | center;
}
return promotionManager.renderPromotionView(ostreeRepo, screen.dimy(),
ostreeRepo.getCommitList().at(visibleCommitViewMap.at(selectedCommit)));
});

// interchangeable view (composed)
Manager manager(infoView, filterView, promotionView);
Manager manager(infoView, filterView);
Component managerRenderer = manager.managerRenderer;

// FOOTER
Expand Down
5 changes: 2 additions & 3 deletions src/core/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@

// Manager

Manager::Manager(const ftxui::Component& infoView, const ftxui::Component& filterView, const ftxui::Component& promotionView) {
Manager::Manager(const ftxui::Component& infoView, const ftxui::Component& filterView) {
using namespace ftxui;

tabSelection = Menu(&tab_entries, &tab_index, MenuOption::HorizontalAnimated());

tabContent = Container::Tab({
infoView,
filterView,
promotionView
filterView
},
&tab_index);

Expand Down
4 changes: 2 additions & 2 deletions src/core/manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Manager {
int tab_index{0};

std::vector<std::string> tab_entries = {
" Info ", " Filter ", " Promote "
" Info ", " Filter "
};

ftxui::Component tabSelection;
Expand All @@ -30,7 +30,7 @@ class Manager {
ftxui::Component managerRenderer;

public:
Manager(const ftxui::Component& infoView, const ftxui::Component& filterView, const ftxui::Component& promotionView);
Manager(const ftxui::Component& infoView, const ftxui::Component& filterView);
};

class CommitInfoManager {
Expand Down

0 comments on commit 93e0c71

Please sign in to comment.