Skip to content

feat: Add quick-add button to array parameter in Cloud Config #2866

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

Merged
merged 13 commits into from
Jul 7, 2025

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Jul 7, 2025

Summary

  • show notifications on Config page
  • allow adding unique entry to array Config parameters
  • add Action column in Config table

Testing

  • npm run lint (fails: Cannot find module 'eslint/config')
  • npm test (fails: jest: not found)

https://chatgpt.com/codex/tasks/task_e_686b1b37db54832d89ef6887e264b889

Summary by CodeRabbit

  • New Features

    • Added user notifications for success and error messages when performing configuration actions.
    • Introduced an action button to add entries to array-type configuration parameters, supporting JSON input.
  • Style

    • Updated table layout to include a new "Action" column and improved column alignment.
    • Added styles for the new action button with icon and hover effects.
  • Documentation

    • Enhanced modal confirmation text formatting for better readability.

@mtrezza mtrezza added the codex label Jul 7, 2025 — with ChatGPT Connector
Copy link

parse-github-assistant bot commented Jul 7, 2025

🚀 Thanks for opening this pull request!

Copy link

coderabbitai bot commented Jul 7, 2025

Warning

Rate limit exceeded

@mtrezza has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 37 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 248d814 and 6d8a5b3.

📒 Files selected for processing (3)
  • src/dashboard/Data/Config/AddArrayEntryDialog.react.js (1 hunks)
  • src/dashboard/Data/Config/Config.react.js (10 hunks)
  • src/dashboard/Data/Config/Config.scss (1 hunks)
📝 Walkthrough

Walkthrough

The update adds user notifications and a new action for array-type configuration parameters in the config dashboard. It introduces a notification system for transient messages and a button to add unique entries to array parameters, using a modal prompt and direct server update. Minor UI and style adjustments are also included. A new AddArrayEntryDialog component handles the entry input modal.

Changes

File(s) Change Summary
src/dashboard/Data/Config/Config.react.js Added notification system, methods for showing notes and adding array entries, UI for array actions with modal dialog, minor style tweaks.
src/dashboard/Data/Config/AddArrayEntryDialog.react.js Added new component rendering modal dialog for adding entries to array parameters, with input validation and JSON parsing support.
src/dashboard/Data/Config/Config.scss Added styles for action icon button including SVG fill color with dark blue variable.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConfigComponent
    participant ParseServer

    User->>ConfigComponent: Clicks "Add" button on array parameter
    ConfigComponent->>User: Shows AddArrayEntryDialog modal
    User->>ConfigComponent: Submits new entry (JSON or string)
    ConfigComponent->>ParseServer: Sends request to add entry (master key)
    alt Success
        ParseServer-->>ConfigComponent: Success response
        ConfigComponent->>ConfigComponent: Show success notification
        ConfigComponent->>ConfigComponent: Refresh config data
    else Failure
        ParseServer-->>ConfigComponent: Error response
        ConfigComponent->>ConfigComponent: Show error notification
    end
Loading

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.

Copy link

The label codex cannot be used here.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Jul 7, 2025

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

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

@mtrezza mtrezza changed the title Add quick array entry button for Config feat: Add quick array entry button for Cloud Config array parameter Jul 7, 2025
@mtrezza mtrezza changed the title feat: Add quick array entry button for Cloud Config array parameter feat: Add button to Cloud Config array parameter to quickly add new value Jul 7, 2025
@mtrezza mtrezza changed the title feat: Add button to Cloud Config array parameter to quickly add new value feat: Add button to Cloud Config array parameter to insert new value Jul 7, 2025
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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b89456c and ea80fd2.

📒 Files selected for processing (1)
  • src/dashboard/Data/Config/Config.react.js (8 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/dashboard/Data/Config/Config.react.js (1)
Learnt from: mtrezza
PR: parse-community/parse-dashboard#2828
File: src/dashboard/Data/Browser/Browser.react.js:1605-1607
Timestamp: 2025-05-27T12:09:47.644Z
Learning: In script execution dialogs in Parse Dashboard (specifically the `confirmExecuteScriptRows` method in `src/dashboard/Data/Browser/Browser.react.js`), individual `setState` calls to update `processedScripts` counter should be kept as-is rather than batched, because this provides real-time progress feedback to users in the dialog UI.
🪛 GitHub Check: Lint
src/dashboard/Data/Config/Config.react.js

[failure] 484-484:
'e' is defined but never used

⏰ 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 (6)
src/dashboard/Data/Config/Config.react.js (6)

26-26: LGTM: Notification component import

The import statement is correctly added for the notification functionality.


45-48: LGTM: Notification state management

The state variables for managing notifications and timeout are well-structured. The noteTimeout reference will properly handle clearing timers.


140-151: LGTM: Notification rendering logic

The notification rendering logic is well-implemented with proper conditional rendering and error/success state management.


264-270: LGTM: Action column implementation

The conditional rendering of the plus button for Array types is appropriate and follows the established pattern.


291-296: LGTM: Action column header

The header addition is consistent with the existing table structure.


461-474: LGTM: Well-implemented notification method

The showNote method properly manages notification state and automatically clears notifications after 3.5 seconds. The timeout clearing prevents memory leaks.

Copy link

uffizzi-cloud bot commented Jul 7, 2025

Uffizzi Ephemeral Environment deployment-64518

⌚ Updated Jul 07, 2025, 10:13 UTC

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

📄 View Application Logs etc.

What is Uffizzi? Learn more

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: 0

🧹 Nitpick comments (2)
src/dashboard/Data/Config/AddArrayEntryDialog.react.js (2)

14-18: Consider adding PropTypes for better documentation.

The component expects onCancel and onConfirm props but doesn't define PropTypes. Consider adding them for better type safety and documentation.

+import PropTypes from 'prop-types';
+
 export default class AddArrayEntryDialog extends React.Component {
+  static propTypes = {
+    onCancel: PropTypes.func.isRequired,
+    onConfirm: PropTypes.func.isRequired,
+  };
+
   constructor() {

20-22: Consider enhancing validation logic.

The current validation only checks for non-empty values. Consider adding more robust validation such as trimming whitespace or validating JSON format if needed.

  valid() {
-    return this.state.value !== '';
+    return this.state.value.trim() !== '';
  }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ea80fd2 and 17fd7c8.

📒 Files selected for processing (2)
  • src/dashboard/Data/Config/AddArrayEntryDialog.react.js (1 hunks)
  • src/dashboard/Data/Config/Config.react.js (10 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/dashboard/Data/Config/Config.react.js
🧰 Additional context used
🧠 Learnings (1)
src/dashboard/Data/Config/AddArrayEntryDialog.react.js (1)
Learnt from: mtrezza
PR: parse-community/parse-dashboard#2828
File: src/dashboard/Data/Browser/Browser.react.js:1605-1607
Timestamp: 2025-05-27T12:09:47.644Z
Learning: In script execution dialogs in Parse Dashboard (specifically the `confirmExecuteScriptRows` method in `src/dashboard/Data/Browser/Browser.react.js`), individual `setState` calls to update `processedScripts` counter should be kept as-is rather than batched, because this provides real-time progress feedback to users in the dialog UI.
⏰ 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 (3)
src/dashboard/Data/Config/AddArrayEntryDialog.react.js (3)

8-12: LGTM! Clean import structure.

The imports are well-organized and follow the project's component structure.


24-30: Excellent flexible input handling!

The JSON parsing approach is well-designed, allowing users to input both JSON objects and plain strings. The fallback to raw string on parsing failure provides excellent UX flexibility.


32-50: Well-structured modal implementation.

The modal is properly configured with good UX features like autofocus and appropriate disabled state handling. The component integration is clean and follows React best practices.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 7, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 7, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 7, 2025
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: 0

🧹 Nitpick comments (2)
src/dashboard/Data/Config/Config.scss (2)

1-1: Prefer @use over @import for future-proof Sass code

@import is now officially deprecated in Dart Sass; the Sass team recommends migrating to @use / @forward for better namespacing and faster compile times. Unless the rest of the codebase is still on @import, consider switching early to avoid technical debt.

-@import 'stylesheets/globals.scss';
+@use 'stylesheets/globals' as *;

3-7: Class name is very generic – risk of leaking styles

.actionIcon could match unrelated SVG wrappers elsewhere, causing unintended color overrides. Prefix or scope the selector (e.g. .configActionIcon or .Config-table .actionIcon) to minimise collision risk and keep styles discoverable.

-.actionIcon {
+.config-actionIcon {
   svg {
     fill: $lightBlue;
   }
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 80b5e71 and 25d452c.

📒 Files selected for processing (1)
  • src/dashboard/Data/Config/Config.scss (1 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). (6)
  • GitHub Check: Node 22
  • GitHub Check: Node 18
  • GitHub Check: Node 20
  • GitHub Check: Docker linux/amd64
  • GitHub Check: Node Engine Check
  • GitHub Check: Lint

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 7, 2025
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: 0

🧹 Nitpick comments (2)
src/dashboard/Data/Config/Config.scss (2)

4-10: Consider enlarging hit-area for accessibility

25 px × 25 px is below the WCAG-recommended 44 px minimum target size for touch devices, which may frustrate mobile / tablet users when tapping the icon.

-  width: 25px;
-  height: 25px;
+  /* Increase touch target while keeping visual size via padding */
+  width: 44px;
+  height: 44px;
+  padding: 10px; // tweak to centre the SVG

If you’d rather avoid a visual size change, you can keep the SVG at 25 px and simply add transparent padding to reach 44 px.


11-13: Use currentColor instead of hard-coded fill for easier theming

Hard-coding $darkBlue ties the SVG color to this one stylesheet. Setting fill: currentColor; lets the icon inherit from color, so themes or hover/disabled states can be changed in one place without editing SVG rules.

-  svg {
-    fill: $darkBlue;
-  }
+  svg {
+    fill: currentColor;
+    color: $darkBlue; // default, but can be overridden by themes/hover
+  }

This makes the component more flexible while preserving the default palette.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 25d452c and 248d814.

📒 Files selected for processing (3)
  • src/dashboard/Data/Config/AddArrayEntryDialog.react.js (1 hunks)
  • src/dashboard/Data/Config/Config.react.js (10 hunks)
  • src/dashboard/Data/Config/Config.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/dashboard/Data/Config/Config.react.js
  • src/dashboard/Data/Config/AddArrayEntryDialog.react.js
⏰ 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

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 7, 2025
@mtrezza mtrezza changed the title feat: Add button to Cloud Config array parameter to insert new value feat: Add quick-add button to array parameter in Cloud Config Jul 7, 2025
@mtrezza mtrezza merged commit e98ccb2 into alpha Jul 7, 2025
11 checks passed
@mtrezza mtrezza deleted the codex/add--add-entry--button-for-arrays-in-config branch July 7, 2025 10:36
parseplatformorg pushed a commit that referenced this pull request Jul 7, 2025
# [7.3.0-alpha.1](7.2.1...7.3.0-alpha.1) (2025-07-07)

### Features

* Add quick-add button to array parameter in Cloud Config ([#2866](#2866)) ([e98ccb2](e98ccb2))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0-alpha.1

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants