-
Notifications
You must be signed in to change notification settings - Fork 64
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
Use default behavior for platform wide anchors (part I) #4834
Use default behavior for platform wide anchors (part I) #4834
Conversation
… page with anchors
…n and emitting events, use the navigateTo composable helper to handle ff-button navigation
…tances page (opening another tab while also navigating) - switch from click to mouseup events to capture middle mouse button click - simplified the open editor method while fixing aforementioned bugs - used the vue router where possible to preserve navigation integrity
…y combinations when handling navigation
…combinations when handling navigation
…als from being triggered
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4834 +/- ##
=======================================
Coverage 78.74% 78.74%
=======================================
Files 323 323
Lines 15221 15221
Branches 3496 3496
=======================================
Hits 11986 11986
Misses 3235 3235
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…r type from the dashboard link to correctly handle routing
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.
Mixins
I will comment in saying I really don't like our move towards a mixin
approach as it makes the traceability of our in-component variables incredibly difficult and the code general much harder to navigate.
However, I will not block this work for that reason, but just ask, in the future, that we consider for developer-friendly approaches in terms of readibility.
Sidebar Rendering
Also with the open-in-new-tab functionality introduced here, it does also stress how poorly reactive our sidebar is and it's not rendering whenever I open most of the links here.
General Comments
I've also made a few other comments within the changes directly, which have questions I'd like answered
@click.stop.prevent | ||
@mouseup.stop.prevent |
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.
why are these required?
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.
to prevent the click event from bubbling up/down. In the case of the dashboard link being nested inside another anchor/link/button, this prevents opening both parent anchor and dashboard link when clicking (or any other click + keyboard combination) directly on the dashboard link element
kind="secondary" | ||
data-action="open-editor" | ||
:disabled="buttonDisabled" | ||
class="whitespace-nowrap" | ||
@click.stop="openEditor" | ||
:emit-instead-of-navigate="true" | ||
@select="openEditor" |
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.
Why @select
?
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.
another way of preventing click events from bubbling up/down. This is specific to the editor link button, having to open different urls based on the type of click/combination acted upon. Emitting an event instead of propagating the click event when clicked gets rid of a lot of headaches and changes when dealing with event propagation in parent components.
I have to admit, 'select' is not the best choice of name for the event being emitted when clicked
Slowly but surely I'm moving away from the mixin approach, but it will take some time in doing so. The long term solution is to extract all generic stateless functionality into composables and delegate the rest into appropriate stores/services
This is very unfortunate side effect which is made even more obvious by this feature and has a greater impact than the sidebar itself. Because we don't have a safeguard in place and render views before we have all mandatory data for the ui to function properly, there are scenarios where the team selector isn't present and depending on the tab you're opening, even elements on the page misbehave. I am aware of them and will address them in the upcoming period. |
…for-platform-wide-anchors
…for-platform-wide-anchors
Description
First iteration to correct platform wide link interaction to allow mouse+keyboard combinations.
Related Issue(s)
closes #4837
closes #4838
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label