-
-
Notifications
You must be signed in to change notification settings - Fork 820
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(PUI): Make header tabs links to simpilfy new tab behaviour #8779
base: master
Are you sure you want to change the base?
Conversation
@sur5r 👀 |
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8779 +/- ##
==========================================
- Coverage 85.17% 83.72% -1.45%
==========================================
Files 1178 1131 -47
Lines 51807 50557 -1250
Branches 2092 1928 -164
==========================================
- Hits 44125 42329 -1796
- Misses 7141 7776 +635
+ Partials 541 452 -89
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@matmair this is a nice addition. It would make sense to add it for the "Panel" nav tab links too? |
Propaply; should this be included in this patch? |
@matmair yes I think so, should be only very minimal diff |
@SchrodingersGat added |
@@ -66,7 +66,7 @@ export default function AdminButton(props: Readonly<AdminButtonProps>) { | |||
`${server.server.django_admin}${modelDef.admin_url}${props.id}/` | |||
); | |||
|
|||
if (event?.ctrlKey || event?.shiftKey) { | |||
if (event?.ctrlKey || event?.shiftKey || event?.metaKey) { |
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.
As this is used over and over again, maybe it makes sense to extract this into a custom function?
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.
As those are seperate functions/interactions I would keep them seperate for now
@matmair I have noticed something here - the target link is different depending on how the click event is interpreted: Starting PointFrom this starting point, I will click the "Manufacturing" tab: Left Mouse ButtonNavigates to "Manufacturing" page in same tab Left Mouse Button + Control KeyOpens "Manufacturing" page in new tab Middle Mouse ButtonOpens "Manufacturing" page (via demo site) in new tab: Note that the URL in the address bar is different in this case! The same behaviour hapens with the side panels too... |
@SchrodingersGat I am not familiar with middle button. Which control key is this? |
No control key, just click on the link by pressing the scroll wheel on the mouse. Typically this just opens a link in a new tab (similar to ctrl+click). However, it bypasses the browser onClick event system somehow so we can't catch it like a normal click. Somehow, this type of click uses a different baseUrl when generating the link target |
This PR enables opening header tab items per right-click to new tabs.