-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat(ui): Add namespace input to ClusterWorkflowTemplate submit. Fixes #10398 #13596
base: main
Are you sure you want to change the base?
Conversation
This adds support for specifying the namespace when submitting a workflow from a ClusterWorkflowTemplate using an input field on the "Submit Workflow". Initially, I used the `<InputFilter>` component for this so it could take advantage of autocomplete, but then I realized that's not appropriate here because this isn't a filter and we don't want the "x" button to clear the field. Signed-off-by: Mason Malone <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the the contribution!
I've left some comments in-line below.
Also, per the issue, did the submit panel just not work before this? If so, that issue should be labeled a bug and this a fix
@@ -31,6 +34,7 @@ export function SubmitWorkflowPanel(props: Props) { | |||
const {navigation} = useContext(Context); | |||
const [entrypoint, setEntrypoint] = useState(workflowEntrypoint); | |||
const [parameters, setParameters] = useState<Parameter[]>([]); | |||
const [namespace, setNamespace] = useState(props.namespace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is not entirely correct to have props.namespace
be the initial state. For a WorkflowTemplate
, it will always be props.namespace
, and for a ClusterWorkflowTemplate
, it will always be the namespace
state.
This would be particularly relevant in cases where this panel is off-screen but still rendered; the next time it's on-screen, the prop would not be used.
That's normally not how this component is used, but that is why the correctness matters if it were to be used that way.
Also this should be ordered after the useContext
instead of in between the two parameter state variables for better organization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I pushed 59dbea3 to lift the state up to <ClusterWorkflowTemplateDetails>
, which is simpler than handling it here
Also if you want to work on another namespace input in the UI, #12041 is highly requested 🙂 |
Signed-off-by: Mason Malone <[email protected]>
@agilgur5 Thanks for the review!
Due to the bug in #13593, it wasn't possible to click the "Submit" button, so I tested this by rebasing my branch with that fix. I confirmed it's possible to submit it with the fix, so this isn't a bug. |
Signed-off-by: Mason Malone <[email protected]>
Signed-off-by: Mason Malone <[email protected]>
Fixes #10398
Motivation
This adds support for specifying the namespace when submitting a workflow from a ClusterWorkflowTemplate using an input field on the "Submit Workflow" panel.
Modifications
Updates the
<SubmitWorkflowPanel>
to allow specifying the namespace via<TextInput>
. Initially, I used the<InputFilter>
component for this so it could take advantage of autocomplete, but then I realized that's not appropriate here because this isn't a filter and we don't want the "x" button to clear the field.Verification
Tested locally at http://localhost:8081/cluster-workflow-templates:
Screen.Recording.2024-09-14.at.11.44.38.AM.mp4