-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Currently displayed view reloads when editing and saving a different view #3002
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
Conversation
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. |
📝 WalkthroughWalkthroughAdds an optional Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant E as EditViewModal
participant V as Views (Views.react.js)
participant D as Data Layer
U->>E: Save edited view
E->>V: onSave(editedView)
V->>V: determine isEditingCurrentView (compare original/current view)
V->>V: set skipDataReload = !isEditingCurrentView
V->>V: loadViews(app, skipDataReload)
alt Load from server
V->>D: request views
D-->>V: views list
V->>V: build view counts
opt when not skipDataReload
V->>D: reload data for active view
D-->>V: data refreshed
end
else Fallback to local storage
V->>V: load views from localStorage
opt when not skipDataReload
V->>D: reload data for active view
D-->>V: data refreshed
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/dashboard/Data/Views/Views.react.js
(5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Docker linux/amd64
🔇 Additional comments (4)
src/dashboard/Data/Views/Views.react.js (4)
90-90
: LGTM! Good backward-compatible API design.The addition of the
skipDataReload
parameter with a default value offalse
maintains backward compatibility while enabling the new behavior.
135-137
: LGTM! Correct implementation.The condition properly gates the data reload while maintaining the existing safety check for component mount status.
144-146
: LGTM! Consistent error handling.The fallback path correctly respects the
skipDataReload
parameter, ensuring consistent behavior whether views are loaded from the server or local storage.
776-779
: LGTM! Clear implementation with helpful comments.The logic correctly computes
skipDataReload
based on whether the edited view is the currently displayed one. The comments clearly explain the intent, making the code maintainable.Note: This assessment assumes the
isEditingCurrentView
check at Line 760 is correct (see comment above for verification).
…shboard into fix/view-reload
# [7.6.0-alpha.11](7.6.0-alpha.10...7.6.0-alpha.11) (2025-10-14) ### Bug Fixes * Currently displayed view reloads when editing and saving a different view ([#3002](#3002)) ([794a35a](794a35a))
🎉 This change has been released in version 7.6.0-alpha.11 |
New Pull Request Checklist
Issue Description
When editing a View that is different from the currently displaying view and then saving, the currently displaying view's table data was being reloaded unnecessarily.
Approach
The
onConfirm
callback in theEditViewDialog
was always callingloadViews()
without any condition, which internally calledloadData(this.props.params.name)
to reload the currently displayed view's data. Added askipDataReload
parameter to theloadViews()
method. Modified the edit view confirm handler to check if the edited view is the currently displayed view. Only reload data when editing the currently displayed view; otherwise, skip the data reload.Summary by CodeRabbit
Bug Fixes
Refactor