FlowFuse / flowfuse

Build bespoke, flexible, and resilient manufacturing low-code applications with FlowFuse and Node-RED
https://flowfuse.com
Other
245 stars 59 forks source link

Remove trickle down router props #4076

Closed cstns closed 2 days ago

cstns commented 6 days ago

Remove trickle down router props and cohesive way of using team, teamMembership and isVisitingAdmin

Description

Focusing mainly on teamMembership & team props which can be used directly from the permissionsMixin, or using accessing the account store directly where the permission mixin is not used.

The isVisitingAdmin computed prop has also been moved in the permissionsMixin

Related Issue(s)

none

Checklist

Labels

codecov[bot] commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.72%. Comparing base (c03fe4f) to head (3e542b2).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4076 +/- ## ======================================= Coverage 78.72% 78.72% ======================================= Files 284 284 Lines 13009 13009 Branches 2897 2897 ======================================= Hits 10241 10241 Misses 2768 2768 ``` | [Flag](https://app.codecov.io/gh/FlowFuse/flowfuse/pull/4076/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse) | Coverage Δ | | |---|---|---| | [backend](https://app.codecov.io/gh/FlowFuse/flowfuse/pull/4076/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse) | `78.72% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

joepavitt commented 3 days ago

I won't be able to review this today, so if someone else can step in, would appreciate it. My main point of concern is that if a user is logged in and viewing Team 1, and they directly navigate in the browser to a Team 2 page (e.g. viewing instances) that the new view reflects the correct team's data

cstns commented 3 days ago

I added two new tests to cover these specific scenarios

joepavitt commented 2 days ago

@Steve-Mcl thanks Steve, just left my own comments on this too