feat: Add option to reload all or only selected rows after invoking script#3200
Conversation
|
🚀 Thanks for opening this pull request! |
✅ 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. |
📝 WalkthroughWalkthroughAdds a persisted feature flag Changes
Sequence DiagramsequenceDiagram
participant User
participant BrowserCell as BrowserCell
participant ScriptUtils as ScriptUtils
participant Browser as Browser
participant DataBrowser as DataBrowser
User->>BrowserCell: trigger Execute script
BrowserCell->>ScriptUtils: executeScript(script, className, objectId, showNote, onRefresh, onRefreshObjects)
alt reloadDataTableAfterScript == true
ScriptUtils->>Browser: onRefresh()
Browser->>DataBrowser: full data table refresh
else reloadDataTableAfterScript == false
ScriptUtils->>Browser: onRefreshObjects([objectId])
Browser->>DataBrowser: handleRefreshObjects(objectIds)
DataBrowser->>DataBrowser: clear per-object cache\nset _skipPanelClear = true\nrefetch affected panels/objects
end
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly Related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/dashboard/Data/Browser/DataBrowser.react.js`:
- Around line 466-479: The _skipPanelClear flag is left true if
this.props.onRefreshObjects(objectIds) rejects; update handleRefreshObjects to
ensure the flag is always consumed by wrapping the asynchronous call in a
try/finally: set this._skipPanelClear = true before calling
this.props.onRefreshObjects, await the call inside try, and then in finally set
this._skipPanelClear = false so any rejection does not leave the flag set;
reference the handleRefreshObjects method and the this._skipPanelClear field
when making this change.
- Around line 675-713: handleRefreshObjects currently sets this._skipPanelClear
before awaiting this.props.onRefreshObjects and never resets it if the promise
rejects, and it doesn't guard against onRefreshObjects being undefined; update
handleRefreshObjects to check that this.props.onRefreshObjects is a function
before calling it, and wrap the await call in a try/finally so that
this._skipPanelClear is always cleared in the finally block (optionally log the
error in the catch). Reference: method handleRefreshObjects, the field
_skipPanelClear, and this.props.onRefreshObjects.
🧹 Nitpick comments (2)
src/dashboard/Data/Browser/Browser.react.js (1)
188-188: localStorage key is not scoped to the app.The
reloadDataTableAfterScriptkey in localStorage is global across all Parse apps managed by this dashboard instance. This is consistent with howbrowserLimitis stored (also a global key), so this appears intentional. Just noting that switching between apps will share this preference.src/dashboard/Data/Browser/DataBrowser.react.js (1)
2941-2956: Consider extracting the duplicatedexecuteScriptcallback logic.The conditional
onRefresh/onRefreshObjectspattern at lines 2951-2952 is identical to lines 1340-1341. A small helper (e.g.,getScriptRefreshCallbacks()) would keep the two call sites in sync and reduce the chance of future drift.Example helper
+ getScriptRefreshCallbacks() { + return { + onRefresh: this.props.reloadDataTableAfterScript ? this.props.onRefresh : null, + onRefreshObjects: this.props.reloadDataTableAfterScript ? null : this.handleRefreshObjects, + }; + }Then at each call site:
const { onRefresh, onRefreshObjects } = this.getScriptRefreshCallbacks(); executeScript(script, className, objectId, this.props.showNote, onRefresh, onRefreshObjects);
# [8.5.0-alpha.6](8.5.0-alpha.5...8.5.0-alpha.6) (2026-02-10) ### Features * Add option to reload all or only selected rows after invoking script ([#3200](#3200)) ([173b953](173b953))
|
🎉 This change has been released in version 8.5.0-alpha.6 |
# [8.5.0](8.4.0...8.5.0) (2026-02-12) ### Bug Fixes * Auto-formatting not applied when Cloud Config parameter value is outdated and re-fetched from server ([#3182](#3182)) ([84eab36](84eab36)) * Clicking reload button in info panel may display fetched data in incorrect panel ([#3189](#3189)) ([b348ef5](b348ef5)) * Role linking in ACL fails with type error ([#3095](#3095)) ([2070d29](2070d29)) * Security migration from csurf to csrf-sync ([#3188](#3188)) ([a95d8a3](a95d8a3)) * View configuration dialog looses focus while typing and lacks syntax highlighting ([#3183](#3183)) ([715fe8d](715fe8d)) ### Features * Add keyboard shortcut to scroll info panels to top ([#3199](#3199)) ([7535626](7535626)) * Add option to reload all or only selected rows after invoking script ([#3200](#3200)) ([173b953](173b953)) * Add reload button to info panel on long loading time ([#3184](#3184)) ([3712d96](3712d96)) * Add support for script execution invoking dashboard form for user input ([#3201](#3201)) ([159f99d](159f99d))
|
🎉 This change has been released in version 8.5.0 |
Pull Request
Feature
Add option "Script > Reload all rows after run" to reload the whole table or only selected rows after invoking a script. This prevents unnecessarily loading the whole data table and all related info panel data when only some rows may have changed.
If "Reload all rows after run" is disabled, the data table is not re-fetched, meaning any rows that after script invocation would not match the applied filter would still appear in the table. To update the table, the "Refresh" button needs to be clicked.
Summary by CodeRabbit