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: add open exposed url to pod details #3762
Conversation
title="Open Browser" | ||
onClick="{() => window.openExternal(url)}" |
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.
from my understanding user will see "Open Browser" several times if I have like 4 URLs
but how to differentiate each link if I only see "Open Browser"
also does it mean we will have like 5 icons if I have 5 links ?
@@ -51,6 +52,7 @@ const removePodMock = vi.fn(); | |||
|
|||
beforeAll(() => { | |||
(window as any).listPods = listPodsMock; | |||
(window as any).listContainers = listContainersMock.mockResolvedValue([]); | |||
(window as any).kubernetesListPods = kubernetesListPodsMock; | |||
(window as any).removePod = removePodMock; | |||
}); |
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.
we're missing the test of checking if we have links to open URLs and verify that if we click on the button we're redirected to the expected link
Tried on a container without port (node) and can see the Open browser link on the infra node |
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.
See previous comment
d54be32
to
c2972d4
Compare
@benoitf @jeffmaury can you check it, please. I've provided some updates to the current PR: |
The images look good, but could we make the button disabled when the pod is stopped instead of hidden? Otherwise there is some visual movement and the start/stop button changes location. |
maybe a UX question, do we need to display a dropdown/single action when we have only one item rather than just clicking on the button ? |
+1, I would prefer if there's only one there's no drop-down and we just open it. (or maybe longer term there is a separate drop down to select which port and the button always opens?) |
There isn't a problem to make it disable and actionable when we have only one exposed ports. Going to update the PR. |
@deboer-tim @benoitf I've updated the PR, now the situation with buttons following: If pod doesn't have exposed port, button will be visible but disabled, the same state either on running or stopped pod: If pod has only one exposed port, button will handle openning port if pod started, otherwise button visible, but disabled. If pod has several exposed ports, then on stopped state button will display dropdown with disabled buttons, the opposite situation when pod is started, in this case buttons vill be enabled and handle opening particular port. |
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.
on my side it's not working, I saw several duplicated items
going to check it |
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
What does this PR do?
Adds a button to pod details to open the exposed url.
Screenshot/screencast of this PR
What issues does this PR fix or reference?
#2978
How to test this PR?
There is an open url button near refresh button in top right corner of pod details.