Skip to content
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

Dashboard edit #4611

Merged
merged 2 commits into from
Aug 2, 2024
Merged

Dashboard edit #4611

merged 2 commits into from
Aug 2, 2024

Conversation

ritch
Copy link
Contributor

@ritch ritch commented Aug 2, 2024

What changes are proposed in this pull request?

image Allows for configuring a new mode/button for `DashboardView`. This allows a panel to implement `on_edit_item` similarly to `on_remove_item` and `on_add_item`.

How is this patch tested? If it is not, please explain why.

With the new custom dashboard plugin.

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

Summary by CodeRabbit

  • New Features

    • Introduced item editing functionality in the Dashboard, allowing users to edit items directly from the grid layout.
    • Added properties for item management, including controls for adding, deleting, and editing items.
  • Enhancements

    • Improved the interactivity of the Dashboard by enabling an edit button for individual grid items.
    • Updated the JSON representation of the DashboardView to include new item management properties.

@ritch ritch self-assigned this Aug 2, 2024
@ritch ritch requested a review from imanjra August 2, 2024 15:17
Copy link
Contributor

coderabbitai bot commented Aug 2, 2024

Walkthrough

The recent updates introduce enhanced item management capabilities in the DashboardView. Users can now edit items directly within the grid layout, thanks to the new allow_edit property. This addition, along with the capability for item addition and deletion, streamlines user interactions and improves overall dashboard functionality.

Changes

Files Change Summary
app/.../DashboardView.tsx, fiftyone/operators/types.py Added allow_edit, allow_addition, and allow_deletion properties to enhance item management. Implemented an edit button in the dashboard for interactive editing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DashboardView
    participant Item

    User->>DashboardView: Click on Edit Button
    DashboardView->>Item: Trigger onEditItem
    Item->>DashboardView: Send item ID and path
    DashboardView->>User: Display edit interface
Loading

🐰 "In the grid so bright and neat,
With buttons now, oh what a treat!
Edit, add, and delete with glee,
A dashboard dance, so lively and free!
Hoppin' with joy, we cheer and play,
For interactivity's here to stay!" 🐰


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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
Contributor

@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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f1c841e and 10a3cb7.

Files selected for processing (2)
  • app/packages/core/src/plugins/SchemaIO/components/DashboardView.tsx (4 hunks)
  • fiftyone/operators/types.py (1 hunks)
Additional context used
Path-based instructions (1)
app/packages/core/src/plugins/SchemaIO/components/DashboardView.tsx (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Additional comments not posted (6)
app/packages/core/src/plugins/SchemaIO/components/DashboardView.tsx (4)

74-74: Addition of allow_edit property looks good.

The allow_edit property is correctly added to the schema view configuration.


82-92: Addition of onEditItem callback looks good.

The onEditItem callback is correctly defined using useCallback and triggers the on_edit_item event with the item's ID and path.


172-220: Changes in the rendering logic of GridLayout look good.

The edit button is conditionally rendered based on the allow_edit flag and is designed to stop event propagation to avoid triggering other click events.


236-244: Usage of DynamicIO component looks good.

The DynamicIO component is correctly passed the necessary props to render the item content within the grid layout.

fiftyone/operators/types.py (2)

2102-2112: Addition of allow_edit property in the constructor looks good.

The allow_edit property is correctly added to the constructor of the DashboardView class with a default value of True.


2119-2119: Update to to_json method looks good.

The to_json method is correctly updated to include the allow_edit property in the JSON representation of the DashboardView class.

Copy link
Contributor

@imanjra imanjra left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 10a3cb7 and 4b9d233.

Files selected for processing (2)
  • app/packages/core/src/plugins/SchemaIO/components/DashboardView.tsx (3 hunks)
  • fiftyone/operators/types.py (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • app/packages/core/src/plugins/SchemaIO/components/DashboardView.tsx
  • fiftyone/operators/types.py

@ritch ritch merged commit 4f076cc into develop Aug 2, 2024
18 checks passed
@ritch ritch deleted the dashboard-edit branch August 2, 2024 16:16
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.

2 participants