Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Add a field for selecting the target namespace for a plan #134

Closed
mturley opened this issue Oct 14, 2020 · 2 comments · Fixed by #139
Closed

Add a field for selecting the target namespace for a plan #134

mturley opened this issue Oct 14, 2020 · 2 comments · Fixed by #139

Comments

@mturley
Copy link
Collaborator

mturley commented Oct 14, 2020

This came up in an email thread (subject: "How do we set target project?"), and it looks like we'll need to add a field to the General step of the plan wizard for specifying the target namespace. We'll need to add an inventory API query to get the namespace choices for the selected target provider, and disable or hide the field until the target provider is selected.

@mturley
Copy link
Collaborator Author

mturley commented Oct 15, 2020

We'll need to provide the user with the option to either select an existing namespace or create a new one. My pitch is that we use the Select component with the typeahead variant and the isCreatable prop, which can be seen here (check the box for isCreatable): https://www.patternfly.org/v4/components/select#typeahead

It provides a Select in which you can type to search, and if you type something that doesn't match any results it allows you to create that option. @vconzola let me know if that's ok.

Per @jortel we'll have a property at the plan CR top level for this.

@mturley
Copy link
Collaborator Author

mturley commented Oct 15, 2020

Note: in the PF example, when you create a new option, it is added to the dropdown list. if you then select another option or clear the dropdown, it stays in the list. Per @vconzola's request we should prevent this-- on select, if you selected an existing namespace, reset the available options to the original existing namespaces. on clear, do the same. To prevent unnecessary logic this could just check if the length of the options list is greater than the length of the namespaces list before changing them.

Edit: turns out this isn't necessary since the example explicitly adds the created option as custom logic, so we can just leave that out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant