-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group the services list by categories #88
Comments
I don't know if I want extra steps, but I do like the idea of grouping. I wonder if there's a way we could build a faster UI or a UI with more information available without adding an extra step? |
I think the cli-menu separators could be a good start: Extra steps would only be necessary when the service list begins to be too long. The same way multi-steps forms are only relevant in some cases. |
Yah, I like that! |
Bear with me here, as this would need serious refactoring and is for now only generating the menu, but here is the raw idea: public function handle(): void
{
[…]
$databaseServices = [
'mariadb' => 'MariaDB',
'mysql' => 'MySQL',
'mssql' => 'MS SQL'
];
$searchServices = [
'meilisearch' => 'MeiliSearch',
'elasticsearch' => 'ElasticSearch'
];
$option = $this->menu('Services to enable')->setTitleSeparator('=');
/* displayCategory() private method */
$option->addStaticItem('Database:')->addStaticItem('---------');
foreach ($databaseServices as $service => $name) {
$option->addOption($service, $name);
}
$option->addLineBreak('', 1);
/* End of the displayCategory() private method */
/* Start of the displayCategory() private method */
$option->addStaticItem('Search:')->addStaticItem('-------');
foreach ($searchServices as $service => $name) {
$option->addOption($service, $name);
}
$option->addLineBreak('', 1);
/* End of the displayCategory() private method */
$option->setPadding(2, 5)->open();
if (!$option) {
return;
}
$this->enable($option);
} Terminal preview:I think it's safe to assume that people using Takeout will do so on a laptop or desktop, which means a minimum screen height of 768px. When taking various menu bars into account, we still have around 700px height to work with! |
Yes, please! The concept of categories would help me with the current project to port Lambo to PHP. I'm currently experimenting with calling takeout so that I can find enabled databases and prompt the user to start them if required (for example, when configuring a project with a Jetstream UI). At the moment I am calling
|
I still think this is a great idea, and I love Jon's note about using these in the CLI |
As soon as Takeout integrate a categories concept for its services, I'll gladly leverage it to submit that feature in a proper PR 🙂 I've tried to add the concept of categories to the core of Takeout, but I am not comfortable enough with the codebase. |
takeout use One way could be make a PR to Alternative way is grouping services and iterate in some way foreach($groups as $group => $values ) {
$option = $this->menu("Group {$group}", $this->enableableServices($values))
->addLineBreak('', 1)
->setPadding(2, 5);
} In all cases to a better classification/grouping of Service we can add a property on what do you think about it? |
Grouping and iterating is the way to go IMHO 👍 In what I envision, each service should have a If you can bring the category concept to services, that would be very welcome indeed. PS: That terminal preview is not just a mockup, it's actually a screenshot of a running hacked version of Takeout. I didn't need to tweak the |
Services grouped by category in #135 . I never used Minio maybe storage isn't the right place 🙈 @mattstauffer i can implement also Jon's note 😇 |
You rock, Daniele! I've added a custom visual improvement I wanted to add, feel free to implement or reject it :) https://github.com/tighten/takeout/pull/135/files#r494363191 |
Closed via #135 |
Issue:
Takeout currently sorts the services list by alphabetical order.
As more and more services will be added to the list, it might become a bit confusing to browse.
Suggestion:
Each service could have a
category
property, which could be used to at least group similar services.Examples of categories:
Improvement:
The
takeout enable
command could now have two steps instead of one:The text was updated successfully, but these errors were encountered: