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

fix: file picker widgets removing files causing abnormal content #31646

Merged
merged 2 commits into from Mar 11, 2024

Conversation

gzlinzihong
Copy link
Contributor

@gzlinzihong gzlinzihong commented Mar 11, 2024

Description

fix filepicker widgets selects multiple files and then removes one of them, causing the final content of all file.data to be abnormal

PR fixes following issue(s)

Fixes # (issue number)

31411

Type of change

  • Bug fix

Testing

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration.

  • Cypress

Test Plan

Add Testsmith test cases links that relate to this PR

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features
    • Enhanced the File Picker widget to support more interactive functionalities like setting maximum file limits and custom data formats.
  • Tests
    • Added tests for new functionalities in the File Picker widget, including file uploading, setting restrictions, and file removal verification.
  • Bug Fixes
    • Fixed an issue with file data retrieval in the File Picker widget to ensure accurate data is presented after files are removed.

Copy link
Contributor

coderabbitai bot commented Mar 11, 2024

Walkthrough

The updates involve enhancing the file picker widget by introducing a fileMap object for better management of selected files and ensuring the integrity of file data upon removal. These changes aim to improve user interaction with the widget, such as setting maximum files, specifying data formats, and facilitating file uploads and removals, while also ensuring that the data associated with files remains accurate and consistent after files are removed.

Changes

File Path Change Summary
.../e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_spec.js Added tests for file removal, updated interactions for file uploads/removals, and verified file data integrity.
.../src/widgets/FilePickerWidgetV2/widget/index.tsx Introduced fileMap for file management, changed file data retrieval to use fileMap.

Related issues

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-tests 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 tests 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 tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@sneha122
Copy link
Contributor

/build-deploy-preview skip-tests=true

@sneha122
Copy link
Contributor

/ok-to-test tags="@tag.All"

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8231028727.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 31646.
recreate: .

Copy link

Whoa, @tag.All spotted in your test suite! 🚀
While @tag.All is cool, like a catch-all net, why not try specific tags? 🏷️
Narrow down your suite with specific tags for quicker and more accurate tests! 🚀 Less waiting, more zipping through tests like a ninja!
Explore the tags documentation here

Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/8231033868.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

@sneha122 sneha122 added Integrations Pod Issues related to a specific integration Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. labels Mar 11, 2024
Copy link

Deploy-Preview-URL: https://ce-31646.dp.appsmith.com

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8231033868.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/OtherUIFeatures/GlobalSearch_spec.js

  2. cypress/e2e/Regression/ClientSide/Widgets/Migration_Spec.js
  3. cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts
To know the list of identified flaky tests - Refer here

@sneha122
Copy link
Contributor

@gzlinzihong Can you please pull latest release branch and merge it into this branch?

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8231033868.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@gzlinzihong
Copy link
Contributor Author

@gzlinzihong Can you please pull latest release branch and merge it into this branch?

Hi @sneha122 done
thank you for your patience!

@sneha122
Copy link
Contributor

Hi @gzlinzihong Thank you so much for creating separate PRs, we can close this one now as all checks have passed 🚀

@yatinappsmith yatinappsmith merged commit 85269c4 into appsmithorg:release Mar 11, 2024
15 checks passed
@sneha122
Copy link
Contributor

@gzlinzihong PR is merged, thank you for your valuable contribution!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Pod Issues related to a specific integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants