-
Notifications
You must be signed in to change notification settings - Fork 266
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: adds menu for actions on containers #804
Conversation
Pushed this functionality in a new PR! I've updated the code from your advice and implemented:
I tried implementing #800 but decided to use the tutorial from svelte here instead: https://svelte.dev/tutorial/actions |
e8c8fa1
to
37425d9
Compare
TODO:
|
0140dca
to
8a7be98
Compare
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.
Looks good to me
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.
it looks like the kebab menu will be specific to ContainerActions and can't be used elsewhere ?
Probably we need instead of
{#if showMenu}
<div id="dropdown"
<KebabMenu>
<KebabMenuItem title="" onClick="" hidden=>
https://svelte.dev/repl/8e68120858e5322272dc9136c4bb79cc?version=3.5.1
Yes you're right! I'll make it modular so we can use this somewhere else. Makes it easier to implement the kebab menu on pod list, future sections, etc. |
dc34693
to
c5e260e
Compare
@benoitf @vzhukovs Updated the PR and it's ready for review! I've completed:
Please note the Hopefully this is good Svelte code, and if it's not I'm open ears to any form of criticism as I'm still learning 💯 |
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.
Hello,
I still do believe the trash icon should be visible as it's a primary action I'm using as often as start/stop
<!-- Dropdown menu for all other actions --> | ||
{#if showMenu} | ||
<div | ||
id="dropdown" | ||
class="origin-top-right absolute right-0 z-10 m-2 rounded-md shadow-lg bg-zinc-700 ring-1 ring-black ring-opacity-5 divide-y divide-gray-600 focus:outline-none"> | ||
<slot /> | ||
</div> | ||
{/if} |
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.
really good improvement over the previous version
esc key works, display is not collapsed on the right
mVnFNJbq3K.mp4
but the drop down should be displayed before the pointer when we click on elements at the bottom because while it works fine for upper rows, clicking on the rows near the bottom, the menu is displayed at the bottom and then we need another scroll. It should be displayed in that case at the opposite side
<!-- Dropdown menu for all other actions --> | ||
{#if showMenu} | ||
<div | ||
id="dropdown" |
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.
id should not be hardcoded as we've multiple dropdown on the page
{#if showMenu} | ||
<div | ||
id="dropdown" | ||
class="origin-top-right absolute right-0 z-10 m-2 rounded-md shadow-lg bg-zinc-700 ring-1 ring-black ring-opacity-5 divide-y divide-gray-600 focus:outline-none"> |
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.
divide-violet-600
?
it looks like also that the dark theme is not following the same state than on the navbar or on the container list
display: dark item, hovering = lighter
here we have a light gray
I noticed a small issue: rounded corner seems to be off when hovering the element
F13LWtAAfy.1.mp4
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.
the menu doesn't disappear when I click on an item
so for example clicking again will do an action on the next row which is not an expected behaviour
A4Kwhg3WRz.mp4
I've updated the PR with the following:
@benoitf I've been having troubles implementing the dropdown menu to go either UP or DOWN, any ideas? I was thinking if cursor is on tophalf of the screen when clicking, drop down, if the cursor is bottom half, drop up? Would that be a good way to implement it? |
I created a PR against your branch: |
@benoitf Merged. Thank you so much for the help / insight! 🎉 |
bf67680
to
60b637b
Compare
### What does this PR do? * This PR adds a "kebab" menu for the actions on containers ### Screenshot/screencast of this PR <!-- Please include a screenshot or a screencast explaining what is doing this PR --> ### What issues does this PR fix or reference? <!-- Please include any related issue from Podman Desktop repository (or from another issue tracker). --> This menu was implemented while testing out containers#506 ### How to test this PR? `yarn watch` and press the action button <!-- Please explain steps to reproduce --> Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
…er click Change-Id: I36b990a88546119180b39464f038ee7fb8d97499 Signed-off-by: Florent Benoit <fbenoit@redhat.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
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.
feat: adds menu for actions on containers
What does this PR do?
Screenshot/screencast of this PR
What issues does this PR fix or reference?
This menu was implemented while testing out #506
How to test this PR?
yarn watch
and press the action buttonSigned-off-by: Charlie Drage charlie@charliedrage.com