Make ockam project delete
(no args) interactive by asking the user to choose from a list of space and project names to delete (tuify)
#6461
Labels
Component: Command
hacktoberfest
Apply to issues you want contributors to help with
help wanted
Implementation: Rust
Type: User Experience
Current behavior
When a user runs
ockam project delete
without any arguments, currently they are shown an error & some help text is displayed asking them to provide the<SPACE_NAME>
and<PROJECT_NAME>
. Here's a screenshot of this.Desired behavior
Instead of displaying this help text, change the behavior of this command so that it becomes interactive with the user. Note that this can only be allowed to happen if:
--no-input
or--quiet
flags have not been passed, and,The user needs to be asked for 2 things:
<SPACE_NAME>
<PROJECT_NAME>
This what the user flow should look like in interactive mode.
Use the tuify crate's
select_from_list()
function to ask the user to select from a list of space names. They should be able to make a single selection. If there are none, then simply display a message saying that none exist (not an error) and exit.Use the tuify crate's
select_from_list()
function to ask the user to select from a list of project names (for their given space name). They should be able to make a multiple selections.Once the user has made their selection(s), display a confirmation prompt letting the user know that that a destructive operation is about to take place with the space name and project name(s) (belonging to that space) they have selected. Use
select_from_list()
to display this prompt. They should be able to make a single selection.If they choose "YES", then delete each selected project from the space, and display a success / failure message for each project that got deleted from the space.
Implementation details
Please use the functions
select_multiple
, andconfirm_interactively
in this file.Here's a similar PR to get some ideas from: delete node interactively #6480
You can learn more about how to use the
select_from_list()
in the tuify crate here. Here is an example that is very similar to the steps you might have to take for this issue.Here's a file you can look at to detect when a terminal is interactive or not.
Here's a file you can look at to see where the
ockam project delete
command is implemented.We love helping new contributors! ❤️
If you have questions or need help as you explore, please join us on Discord. If you're looking for other issues to contribute to, please checkout our good first issues.
The text was updated successfully, but these errors were encountered: