Skip to content

feat: Add dashboard configuration store on Parse Server #2860

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

Open
wants to merge 3 commits into
base: alpha
Choose a base branch
from

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Jun 22, 2025

New Pull Request Checklist

Issue Description

Closes: #2555

Approach

TODOs before merging

Summary by CodeRabbit

  • New Features

    • Added the ability for users to save and load dashboard column and class preferences to the server, enabling persistent customization across sessions.
    • New "Save" buttons appear in the dashboard settings when server-side preferences are enabled.
  • Documentation

    • Updated the README with instructions on enabling and using server-side dashboard configuration saving.
  • Chores

    • Simplified import paths within the project for easier code maintenance.

Copy link

parse-github-assistant bot commented Jun 22, 2025

🚀 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.

Copy link

coderabbitai bot commented Jun 22, 2025

Warning

Rate limit exceeded

@dblythy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 3 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b788f9e and f5e6478.

📒 Files selected for processing (1)
  • src/lib/ColumnPreferences.js (1 hunks)
📝 Walkthrough

Walkthrough

The changes introduce server-side storage and retrieval of dashboard configuration preferences, including columns and class settings. This is achieved by adding new functions for loading and saving preferences from/to a Parse class, updating React components to support these operations, and documenting the feature and its configuration in the README.

Changes

File(s) Change Summary
README.md Added documentation for enabling and using server-side dashboard configuration storage.
jsconfig.json Added module path aliases and set baseUrl to "src" for simplified imports.
src/dashboard/Data/Browser/Browser.react.js Added logic to load column and class preferences from server if preferencesClassName is set in context.
src/dashboard/Settings/DashboardSettings/DashboardSettings.react.js Added UI and methods to save column and class preferences to server using Parse; uses new context property.
src/lib/ClassPreferences.js Added load and setClassPreferences functions for server-side loading and merging of class preferences.
src/lib/ColumnPreferences.js Added load function for server-side loading of column preferences.
src/lib/ParseApp.js Updated constructor to accept preferencesClassName and delegate preference setting to new function.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DashboardSettings
    participant ParseServer

    User->>DashboardSettings: Clicks "Save Columns" or "Save Classes"
    DashboardSettings->>ParseServer: Query for existing preferences object
    alt Preferences object exists
        DashboardSettings->>ParseServer: Update preferences object with new data
    else Preferences object does not exist
        DashboardSettings->>ParseServer: Create new preferences object with ACL
    end
    ParseServer-->>DashboardSettings: Confirmation of save
    DashboardSettings-->>User: Show success or error notification
Loading
sequenceDiagram
    participant BrowserComponent
    participant ParseServer

    BrowserComponent->>ParseServer: Query for stored column/class preferences (on mount)
    ParseServer-->>BrowserComponent: Return preferences data (if any)
    BrowserComponent->>BrowserComponent: Merge and apply preferences locally
Loading

Assessment against linked issues

Objective Addressed Explanation
Store dashboard options server side via configurable Parse class (e.g., preferencesClassName) (#2555)
Load and apply preferences from server, replacing or merging with local storage (#2555)
Provide UI to save current dashboard preferences to server (#2555)
Document configuration and usage of server-side preferences (#2555)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Jun 22, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
src/lib/ColumnPreferences.js (1)

13-13: Consider using aliased imports for consistency.

With the new path aliases configured in jsconfig.json, you could use import Parse from 'lib/Parse' or similar for consistency with the new module resolution setup.

README.md (1)

404-404: Fix typo in the documentation.

There's a typo: "confiugration" should be "configuration".

-You can save the confiugration on the server by specifying `preferencesClassName`
+You can save the configuration on the server by specifying `preferencesClassName`
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d74638f and 0ac246f.

📒 Files selected for processing (7)
  • README.md (1 hunks)
  • jsconfig.json (1 hunks)
  • src/dashboard/Data/Browser/Browser.react.js (1 hunks)
  • src/dashboard/Settings/DashboardSettings/DashboardSettings.react.js (5 hunks)
  • src/lib/ClassPreferences.js (1 hunks)
  • src/lib/ColumnPreferences.js (1 hunks)
  • src/lib/ParseApp.js (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/lib/ClassPreferences.js (1)
Learnt from: mtrezza
PR: parse-community/parse-dashboard#2769
File: src/lib/ClassPreferences.js:26-26
Timestamp: 2025-05-02T11:55:52.809Z
Learning: Preference reads and writes in the ClassPreferences.js module are expected to be infrequent operations, so optimizing for performance (like caching) is unnecessary in this context.
🪛 GitHub Check: Lint
src/lib/ClassPreferences.js

[failure] 29-29:
Expected indentation of 6 spaces but found 12


[failure] 28-28:
Expected indentation of 6 spaces but found 12


[failure] 27-27:
Expected indentation of 8 spaces but found 14


[failure] 26-26:
Expected indentation of 6 spaces but found 12


[failure] 25-25:
Expected indentation of 4 spaces but found 10


[failure] 24-24:
Expected indentation of 4 spaces but found 10


[failure] 23-23:
Expected indentation of 4 spaces but found 10


[failure] 8-8:
Expected indentation of 4 spaces but found 8


[failure] 7-7:
Expected indentation of 4 spaces but found 8


[failure] 6-6:
Expected indentation of 4 spaces but found 8

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Docker linux/amd64
🔇 Additional comments (12)
jsconfig.json (1)

3-9: LGTM! Clean module resolution configuration.

The addition of baseUrl and path aliases will enable cleaner imports throughout the project, making the codebase more maintainable.

src/lib/ColumnPreferences.js (1)

16-19: Review security implications of using master key on client.

Using useMasterKey: true in client-side code could potentially expose sensitive operations. Ensure this is intentional and that the preferences class has appropriate ACLs configured.

#!/bin/bash
# Search for other uses of useMasterKey in the codebase to understand the pattern
rg "useMasterKey.*true" -A 2 -B 2
src/lib/ParseApp.js (3)

11-11: LGTM!

Clean refactoring of the import to use the new centralized setClassPreferences function.


53-53: LGTM!

Proper addition of the preferencesClassName parameter to support server-side preference storage.


83-83: LGTM!

Good refactoring that replaces manual preference merging logic with a centralized call to setClassPreferences. This improves maintainability and consistency across the codebase.

Also applies to: 114-114

src/lib/ClassPreferences.js (2)

2-2: LGTM!

Appropriate import of Parse for server-side functionality.


4-15: LGTM!

The load function correctly queries the Parse server for user preferences and applies them using the centralized preference setting logic.

src/dashboard/Settings/DashboardSettings/DashboardSettings.react.js (5)

23-24: LGTM!

Proper setup of Parse import and CurrentApp context for accessing app configuration.

Also applies to: 27-27


55-55: LGTM!

Good initialization of showSavePreferences state based on the presence of preferencesClassName in the app context.


70-97: LGTM!

The saveColumns method correctly implements server-side persistence with proper ACL setup, error handling, and user feedback.


110-133: LGTM!

The saveClasses method follows the same solid pattern as saveColumns with appropriate error handling and notifications.


428-431: LGTM!

Proper conditional rendering of the Save Column Preferences button when server-side saving is enabled.

Copy link

uffizzi-cloud bot commented Jun 22, 2025

Uffizzi Ephemeral Environment deployment-64323

⌚ Updated Jun 22, 2025, 09:52 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2860

📄 View Application Logs etc.

What is Uffizzi? Learn more

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 22, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 22, 2025
@mtrezza mtrezza changed the title feature: save configuration on server feat: Add dashboard configuration store on Parse Server Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add configuration store on server
2 participants