-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
fix(ui): UI bug fixes #4895
fix(ui): UI bug fixes #4895
Conversation
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
Signed-off-by: Alex Collins <alex_collins@intuit.com>
@@ -38,7 +38,7 @@ export const EventFlowPage = ({history, location, match}: RouteComponentProps<an | |||
// state for URL and query parameters | |||
const [namespace, setNamespace] = useState(match.params.namespace || ''); | |||
const [showFlow, setShowFlow] = useState(queryParams.get('showFlow') === 'true'); | |||
const [showWorkflows, setShowWorkflows] = useState(queryParams.get('showWorkflows') === 'true'); |
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.
default this low risk feature on
@@ -2,9 +2,15 @@ import {GetUserInfoResponse, Info, Version} from '../../../models'; | |||
|
|||
import requests from './requests'; | |||
|
|||
let info: Promise<Info>; // we cache this globally rather than in localStorage so it is request once per page refresh |
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.
cache info in memory so we don't retrieve it repeatedly
</button> | ||
</div> | ||
</Notice> | ||
<textarea ref={hiddenText} style={{width: 0, height: 0, opacity: 0}} defaultValue={text} /> |
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.
remove a React warning
@@ -47,7 +47,7 @@ export const WidgetGallery = ({namespace, name, label}: {namespace: string; name | |||
</div> | |||
<ul> | |||
{parameters.map(p => ( | |||
<li> | |||
<li key={p.name}> |
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.
remove a React warning
@@ -26,7 +26,7 @@ export const WorkflowCreator = ({namespace, onCreate}: {namespace: string; onCre | |||
.list(namespace) | |||
.then(setWorkflowTemplates) | |||
.catch(setError); | |||
}, []); | |||
}, [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.
correct deps
@@ -195,7 +196,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< | |||
); | |||
retryWatch.start(workflow.metadata.resourceVersion); | |||
return () => retryWatch.stop(); | |||
}, [workflow]); | |||
}, [namespace, name]); |
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.
this was a pretty nasty bug, every time we got a changed workflow, we re-established the watch, resulting in a hot loop
@@ -81,7 +81,8 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< | |||
if (workflowOperation.title === 'DELETE') { | |||
navigation.goto(uiUrl(`workflows/${workflow.metadata.namespace}`)); | |||
} else { | |||
navigation.goto(uiUrl(`workflows/${wf.metadata.namespace}/${wf.metadata.name}`)); | |||
// navigation.goto does not seem to work here | |||
document.location.href = uiUrl(`workflows/${wf.metadata.namespace}/${wf.metadata.name}`); |
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.
not sure why, not a big enough issue to properly
Checklist: