-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
feat: added the code to sort the collection in the proper order. #35413
feat: added the code to sort the collection in the proper order. #35413
Conversation
WalkthroughThe changes enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DatasourceTrigger
participant DatasourceStructure
User->>DatasourceTrigger: trigger()
DatasourceTrigger->>DatasourceStructure: getStructure()
DatasourceStructure-->>DatasourceTrigger: return tables
DatasourceTrigger->>User: return ordered collections
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 UI
Review profile: CHILL
Files selected for processing (2)
- app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/DatasourceTriggerSolutionCEImpl.java (2 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/DatasourceTriggerSolutionTest.java (1 hunks)
Additional comments not posted (3)
app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/DatasourceTriggerSolutionCEImpl.java (2)
30-31
: Imports look good.The new imports for
Comparator
,HashMap
,List
,Map
, andOptional
are appropriate for the changes made to thetrigger
method.
132-148
: LGTM! But verify the function usage in the codebase.The changes to the
trigger
method enhance the structure of the data being processed and ensure that the final output is ordered. The logic for creating maps and adding them to the result list is clear and the sorting step is implemented correctly.However, ensure that all function calls to
trigger
handle the new result structure correctly.app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/DatasourceTriggerSolutionTest.java (1)
206-271
: The new test method is well-structured and effective.The test method
datasourceTriggerTest_should_return_collections_inorder
is well-structured and effectively validates the ordering of collections. The use of Mockito for mocking dependencies is appropriate and the assertions ensure the correctness of the order.
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10260988337. |
Deploy-Preview-URL: https://ce-35413.dp.appsmith.com |
Hii @NilanshBansal @sneha122 @nidhi-nair , could you please assign reviewer to this PR. thank you. |
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
Hii @NilanshBansal @sneha122 @nidhi-nair @rohan-arthur , could you please assign reviewer to this PR. thank you. |
Added @sneha122 as reviewer as she has checked this earlier |
defaultEnvironmentId, | ||
new TriggerRequestDTO("ENTITY_SELECTOR", Map.of(), ClientDataDisplayType.DROP_DOWN)); | ||
|
||
Mono<TriggerResultDTO> columnNamesMono = datasourceTriggerSolution.trigger( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Naveen-Goud Is columnNamesMono required? I don't see it being used anywhere, if that's the case, can you please remove it?
...psmith-server/src/test/java/com/appsmith/server/solutions/DatasourceTriggerSolutionTest.java
Show resolved
Hide resolved
Created shadow Pr here to track the test cases |
Hii @sneha122 , I have updated the test case. Can you check now . |
Thank you @Naveen-Goud for prompt response, test cases are running on the shadow PR, will let you know if anything fails there |
There was a problem hiding this 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
Files selected for processing (1)
- app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/DatasourceTriggerSolutionTest.java (1 hunks)
...psmith-server/src/test/java/com/appsmith/server/solutions/DatasourceTriggerSolutionTest.java
Show resolved
Hide resolved
…smithorg#35413) **Description:** The collection dropdown in MongoDB query editor isn't sorted, typing to filter doesn't work, and hitting a key like u doesn't scroll to the next item starting with you. fixes: [28190](appsmithorg#28190) **Updated in PR:** 1.Added the sort code to the collection after Api trgger. 2.Added the test case for this scenario. **snap shots:** ![Screenshot from 2024-08-05 16-07-18](https://github.com/user-attachments/assets/8c75866f-c843-455e-80e0-1cb6d4e893ce) ![Screenshot from 2024-08-05 16-22-29](https://github.com/user-attachments/assets/4452f99d-2b6e-42aa-82b3-38bc256af216) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the output structure of the datasource trigger, providing a clearer representation of entities with labels and values. - Implemented case-insensitive sorting for the returned collections, improving data usability. - **Tests** - Added a new test to validate the ordering of collections returned by the datasource trigger, ensuring data integrity and expected behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description:
The collection dropdown in MongoDB query editor isn't sorted, typing to filter doesn't work, and hitting a key like u doesn't scroll to the next item starting with you.
fixes: 28190
Updated in PR:
1.Added the sort code to the collection after Api trgger.
2.Added the test case for this scenario.
snap shots:
Summary by CodeRabbit
New Features
Tests