appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

fix:added a method to identify the data types properly and show in th…

Open Naveen-Goud opened this issue 1 year ago • 8 comments

Description of PR

  • this pr contains the changes to handle the data types from the user regarding feature

Changes in PR

  • In this PR added a method ,which takes the json data and it identifies the datatypes, then saves in firestore as expected.

fixes- #7176

output

  • below are the screen shots , after sending the data, they are stored in firestore with proper datatype format. Screenshot from 2024-05-31 16-26-01 Screenshot from 2024-05-31 16-26-52 Screenshot from 2024-05-31 16-27-06

below is the screen shot, when we try to get the documents then they are also represented based on their format Screenshot from 2024-05-31 16-28-26

Summary by CodeRabbit

  • New Features

    • Enhanced data handling capabilities for geolocation and timestamp data in the Firestore integration.
    • Improved validation for Firestore document references.
    • Added robust data conversion methods for better formatting of Firestore data.
  • Bug Fixes

    • Fixed issues related to incorrect formatting of timestamp and geolocation data.
  • Tests

    • Introduced a new test suite for validating the functionality of the Firestore plugin against an emulated Firestore environment.

Naveen-Goud avatar Aug 05 '24 05:08 Naveen-Goud

Walkthrough

The updates to the FirestorePlugin class significantly enhance its functionality, specifically in handling geolocation and timestamp data. New constants and a regex pattern improve data validation, while modifications to the methodAddToCollection and resultToMap methods ensure accurate data conversion and formatting. These changes facilitate better integration with Firestore, leading to more consistent and usable data within the application.

Changes

File Path Change Summary
app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/plugins/FirestorePlugin.java - Added constants for geolocation (LATITUDE, LONGITUDE) and Firestore timestamps (SECONDS, NANO_SECONDS).
- Introduced REFERENCE_PATTERN for validation.
- Updated methodAddToCollection for improved handling of geolocation and timestamps via checkAndConvertDataType.
- Enhanced resultToMap for better formatting of Timestamp and GeoPoint.
app/server/appsmith-plugins/firestorePlugin/src/test/java/com/external/plugins/FirestorePluginExecutorTest.java - Introduced a test suite for FirestorePluginExecutor using JUnit and Testcontainers.
- Implemented testMethodAddToCollection to validate document addition and data types in Firestore.

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>, please review it.
    • 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 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 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 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 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.

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.

coderabbitai[bot] avatar Aug 05 '24 05:08 coderabbitai[bot]

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Aug 19 '24 16:08 github-actions[bot]

Hii @somangshu @NilanshBansal @Nikhil-Nandagopal , this PR has been approved , can you merge the changes !!

thank you.

Naveen-Goud avatar Aug 22 '24 09:08 Naveen-Goud

@Naveen-Goud this needs further testing from our end. We will be prioritising this in the next week. cc: @rohan-arthur @carinanfonseca

NilanshBansal avatar Aug 22 '24 10:08 NilanshBansal

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Sep 04 '24 16:09 github-actions[bot]

Hi @rishabhrathod01, I have resolved the comments.Can you review the updated code. thank you.

Naveen-Goud avatar Sep 05 '24 12:09 Naveen-Goud

@Naveen-Goud the server unit test is failing for above PR, could you please check.

rishabhrathod01 avatar Sep 07 '24 19:09 rishabhrathod01

Hii @rishabhrathod01 , I have updated the test files and removed few statement in FirestorePluginTest, since they are covered in test file firestorePluginExecutorTest which contains the test cases that I have written.

thank you.

Naveen-Goud avatar Sep 08 '24 09:09 Naveen-Goud

@Naveen-Goud could you please resolve the merge conflict by taking pull from latest release?

rishabhrathod01 avatar Sep 19 '24 11:09 rishabhrathod01

Hii @rishabhrathod01 , I have resolved the merge conficts , could you review this PR.

thank you.

Naveen-Goud avatar Sep 20 '24 05:09 Naveen-Goud

@Naveen-Goud there are server unit tests that are failing on the PR, could you please resolve them?

cc: @NilanshBansal I have unassigned myself here from the reviewer, we could re-assign the reviewer to this PR.

rishabhrathod01 avatar Sep 26 '24 11:09 rishabhrathod01

Hi @NilanshBansal ,I have checked the test case failing files, those files are not related to the changes I have made.

thank you.

Naveen-Goud avatar Sep 26 '24 12:09 Naveen-Goud

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Feb 04 '25 16:02 github-actions[bot]

This PR has been closed because of inactivity.

github-actions[bot] avatar Feb 25 '25 16:02 github-actions[bot]