FlowFuse / flowfuse

Connect, collect, transform, visualise, and interact with your Industrial Data in a single platform. Use FlowFuse to manage, scale and secure your Node-RED solutions.
https://flowfuse.com
Other
285 stars 64 forks source link

Add "Event Scope" and "Include Children" to Instance Audit Logs #4753

Closed Steve-Mcl closed 2 days ago

Steve-Mcl commented 1 week ago

closes #4750 closes #4751

Description

Adds "Event Scope" and "Include Children" to Instance Audit Logs

NOTE This merges into #4749. To keep #4749 manageable, we should probably not merge this in until that one is approved (but feel free to review and approve this up-front)

NOTE2 This also inadvertently fixes #4751 image

In action UPDATED to include associations as per discussion in #4749 comments

chrome_XA4vdFLv8z

Tests added

  Audit model
    static methods
      buildScopeClause
        for Project
          ✔ should return clause scoped for project only
          ✔ should return clause scoped for devices only
          ✔ should return clause scoped for project and all children

  3 passing (3s)

Related Issue(s)

Owner: #4750 Parent: https://github.com/FlowFuse/flowfuse/issues/4684

Checklist

Labels

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.72%. Comparing base (650d303) to head (3c1c5bc). Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
forge/db/models/AuditLog.js 66.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4753 +/- ## ========================================== + Coverage 78.65% 78.72% +0.07% ========================================== Files 314 314 Lines 15050 15053 +3 Branches 3456 3457 +1 ========================================== + Hits 11838 11851 +13 + Misses 3212 3202 -10 ``` | [Flag](https://app.codecov.io/gh/FlowFuse/flowfuse/pull/4753/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/4753/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FlowFuse) | `78.72% <66.66%> (+0.07%)` | :arrow_up: | 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.


🚨 Try these New Features:

joepavitt commented 1 week ago

Will hold off reviewing until the underling branch has a PR, as I'd like to take a look at that context/basis of this branch too.

Steve-Mcl commented 1 week ago

Will hold off reviewing until the underling branch has a PR.

Not sure what you mean Joe?

The base branch PR is here: https://github.com/FlowFuse/flowfuse/pull/4749 (issue: https://github.com/FlowFuse/flowfuse/issues/4746)

joepavitt commented 1 week ago

Not sure what you mean Joe?

Ah, did go looking but didn't find it, thanks for clarifying Steve

Steve-Mcl commented 4 days ago

@joepavitt I've merged the changes from the base branch and applied the same edits to include the router-link in the audit log. I've updated this PRs 1st post to reflect.

joepavitt commented 3 days ago

Approved, committed some minor amendments to pluralise the labels for "Scope", but not merging as waiting on https://github.com/FlowFuse/flowfuse/pull/4749