fix: read-only banner, avoid rendering it while isLoading#1114
Conversation
Reviewer's GuideRefactors the read-only handling into an Sequence diagram for read-only banner and mutation disabling during trustify info loadsequenceDiagram
actor User
participant DefaultLayout
participant ReadOnlyProvider
participant useFetchTrustifyInfo
participant LoadingWrapper
User->>DefaultLayout: render
DefaultLayout->>ReadOnlyProvider: React.useContext(ReadOnlyContext)
ReadOnlyProvider->>useFetchTrustifyInfo: useFetchTrustifyInfo()
useFetchTrustifyInfo-->>ReadOnlyProvider: { data, isLoading, error }
ReadOnlyProvider-->>DefaultLayout: { isLoading, areMutationsDisabled }
DefaultLayout->>LoadingWrapper: isFetching = isLoading
alt [isLoading]
LoadingWrapper-->>DefaultLayout: isFetchingState (empty)
DefaultLayout-->>User: page content only (no read-only Banner)
else [!isLoading]
opt [error]
LoadingWrapper-->>User: Banner status=danger with getAxiosErrorMessage(error)
end
opt [areMutationsDisabled]
DefaultLayout-->>User: read-only Banner status=info
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1114 +/- ##
==========================================
+ Coverage 52.38% 52.47% +0.09%
==========================================
Files 271 270 -1
Lines 5874 5867 -7
Branches 1842 1839 -3
==========================================
+ Hits 3077 3079 +2
+ Misses 2484 2478 -6
+ Partials 313 310 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/backport |
|
Successfully created backport PR for |
Summary
Improvements:
Related Issues
https://redhat.atlassian.net/browse/TC-4926
Type of Change
Testing
npm test)npm run lint)Screenshots
Summary by Sourcery
Adjust read-only handling to disable mutations while trustify info is loading and prevent the read-only banner from showing during loading.
Enhancements:
Tests:
Chores: