Commit Graph

127 Commits

Author SHA1 Message Date
Sumit Kumar
c2f39f4eda
feat: [server side change only] convert Mongo's form data to raw / native query (#10058) 2022-04-01 18:44:32 +05:30
Sumit Kumar
027161e033
fix smart substitution setting toggle fetch method and path. (#12181)
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-03-24 17:55:32 +05:30
Nidhi
1ca9fd803a
fix: S3 formData path for bucket name (#12049) 2022-03-22 12:56:42 +01:00
Nidhi
c97b7e31e7
chore: Migrations to enable JSON and form mode (#11534)
* feat: added new component to perform generic json raw toggle functionality

* chore: Migration to convert formData references

* fix: Redid migration for per plugin changes, fixed consumption

* fix: Added JSON migration for git import

* Added JSON migration as well

* Reverted client side changes

* fix: Modified plugin config aggregation logic

* Merge conflict fixes

* different paths for different commands

* Whoopsie

* Modified usage to different paths

* Reverting env change

* Config changes to show json mode

* Test fixes

* Migrated body,path,next,prev

* Cypress test fixes

* Modified dynamic binding replacement

* Changed view type

* Reverted json form mode display

* Modified structure of JSON mmigrations

Co-authored-by: Aman Agarwal <aman@appsmith.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-03-21 11:22:14 +05:30
Nidhi
8b1638aba6
chore: Modified plugin config aggregation logic (#11561)
* fix: Modified plugin config aggregation logic

* Modified logs a bit

* Reverted incorrect path from another branch
2022-03-03 19:26:55 +05:30
Mojtaba
29be75e0e9
feat: add smart substitution handling for known MongoDB types (#11135)
* shelf: start working on substitution for `ISODate`

* a draft for Sumit to check what I did wrong in my tests

* test: tests are working

* test: cleanup

* refactor: add replacementDataType parameter to DataTypeStringUtils.jsonSmartReplacementPlaceholderWithValue

* fix: remove quotes for Mongo Types work in single form, arrays and json.

* add handling for more use cases
add/update more TCs

* add comments

* add more comments

* add space (cosmetic change)

Co-authored-by: Sumit Kumar <sumit@appsmith.com>
2022-03-02 22:33:50 +05:30
Mojtaba
dad6dfb636
fix: Fixed test MongoDB datasource shows ok even if there is no database matching the name in the 'Default Database Name' input (#11238) 2022-02-18 10:41:01 +03:30
Mojtaba
497dd1a21b
fix: showing invalid credentials message on MongoDB test datasource if there is an unauthorized error (#11124)
* fix: if test datasource gets Unauthorized accessing admin database
It will try to access the default database.

* fix: fix broken test

* fix: cleanup unused imports

* test: make test more readable with better comments
2022-02-16 14:03:13 +05:30
Félix Suarez Bonilla
9bcd4afff1
feat: Add Mongo Templates for plugin. (#11153)
Adds templates for the Aggregate, Distinct and Count commands for the MongoDB plugin.
2022-02-15 10:29:01 -06:00
Mojtaba
f6463d0cf8
fix: Added stricter validation for Mongo pipeline (#11034)
* fix(mongoPlugin): try to make JSON validation more strict

* test(mongoPlugin): add testAggregateCommandWithInvalidQuery
2022-02-09 22:04:03 +05:30
Favour Ohanekwu
72f8b7e2e1
feat: Support OAuth for all plugin types (#9657)
* customize datasource authorization

* improve performance

* fix save datasource bug

* switch auth type from form config

* better naming of components

* fix minor bug

* minor bug fix

* minor bug fix

* syntax cleanup

* Add comments where necessary

* Added comments where necessary

* fix broken airtable page

* code refactor and annotation
2022-01-14 12:01:54 +05:30
Sumit Kumar
18edb18b20
fix: implement getStructure method for S3 plugin (#8919)
* Add `getStructure` implementation for S3 to return a list of accessible buckets.
* Add command templates for S3.
  - List files
  - Read file
  - Create file
  - Delete file
* Remove getDatasourceMetadata implementation as getStructure method can be directly used now.
2022-01-13 11:33:50 +05:30
Sumit Kumar
f045af8bfc
feat: Mongo plugin: add limit field to aggregate command to allow users to define batchSize (#10257)
* This PR adds a limit field which sets the batchSize for aggregate command. This way the user can set the number of documents they want in their Mongo query result.
* limit is set to 10 initially. However, for pre-existing Mongo actions, migration has been added to set this field to 101 - which is the default value that has been used by Mongodb in the absence of any user set value. Ref: https://docs.mongodb.com/manual/tutorial/iterate-a-cursor/
2022-01-10 16:42:30 +00:00
Leo Thomas
9cd89884bf
fix: 9648 The Update query fails to update for all matching Document in mongo (#9975)
* fix:9648 Mongo update All issue-In Progress

* fix: Mongo Multi update query fail fixes

* Added updated testcases that got affected by the code change

* Changes reverted as per review comments
2021-12-31 19:12:19 +05:30
Nidhi
e6f4513b48
fix: Appends authSource param to mongo URI if absent, also fixes inability to connect to mongo without user info (#9995) 2021-12-24 19:42:04 +05:30
Sumit Kumar
c858edf726
fix Mongo smart substitution for quotes around ObjectId (#9856)
- fix Mongo plugin's smart substitution feature to handle quotes around ObjectId in array. e.g. Initial replacement value: ["ObjectId(xyz)"] , final replacement value: [ObjectId(xyz)]
- unrelated: added version number to lombok dependency to stop build failures in IntelliJ.
2021-12-21 18:47:19 +05:30
Arpit Mohan
96677ef673
fix: Updating log4j to 2.17.0 to prevent JNDI lookups (#9863)
Also making minor edit to not show "Application name updated" toast message. This is a counter-productive toast that is distracting the user
2021-12-20 16:01:08 +05:30
Nayan
28c181b59c
feat: [Feature] Upgrade spring boot version to 2.5.5 (#8932)
Upgrades spring boot version to 2.5.5
2021-12-14 16:22:37 +06:00
Sumit Kumar
611ff3b776
feat: make Mongodb plugin error messages more readable. (#7857)
* Make MongoDB plugin's error messages more readable. A Client side change is required before this change becomes visible to the end user.
2021-09-27 15:10:14 +00:00
Trisha Anand
17baadfb84
Adding input type to BSON fields to ensure future client side validations can be added to these fields (#7596) 2021-09-19 15:34:28 +00:00
Trisha Anand
936f014b3e
feat: Add UQI infrastructure to Mongo Plugin (#7238) 2021-09-17 12:22:22 +00:00
Trisha Anand
cbf7dc2745
feat: New Mongo UQI Plugin with new datastructures (with old UI) (#6666) 2021-09-02 14:00:18 +00:00
Trisha Anand
f6df16bde4
fix: Json smart substitution breaks when evaluated value contains the character '?' (#7031)
* Minor refactoring

* Partial code change to replace question mark with appsmith placeholder

* Working version

* Removing unnecessary code

* Added test case to assert that when evaluated value contains a "?", the replacements are still correct

* Added test case in Mongo Plugin as well for the same scenario

* Minor change in the language of the comment
2021-09-02 12:30:04 +00:00
Trisha Anand
104fd168de
Distinct command output now results a JSON object instead of an array of strings (#6964) 2021-08-30 12:37:13 +00:00
Trisha Anand
23ce13ce98
[Mongo] Added default values for query for Find, Count and Distinct commands (#6960)
* Added smart defaults for query in Count, Distinct & Find commands

* Added test cases for smart inputs for query and limit for find, and query for count and distinct
2021-08-30 11:02:48 +00:00
Nidhi
f2cba9a601
Escaped inputs for bson substitution (#6565) 2021-08-13 14:44:51 +05:30
Trisha Anand
b4b1706946
BSON documents for aggregate pipelines are not valid JSON. Using BSON parse instead of JSON parse to ensure valid Mongo commands don't throw an error (#6583) 2021-08-13 08:00:34 +00:00
Abhijeet
9633d1e1c3
Add autogenerate field in datasource structure for each column (#6018)
* Added field to autogenerate values in DB column

* Added comment and refactor

* Autogenerate field update according to names instead of type for ArangoDB
2021-07-23 09:00:32 +05:30
Trisha Anand
18fa47e2b4
Taking Smart Substitution for Mongo out of Beta (#5650) 2021-07-08 11:25:53 +05:30
Trisha Anand
9dfe66d45c
[Bug] Mongo Plugin : Handle socket exception when the connection is dropped by Mongo database (#5499) 2021-07-01 17:23:24 +05:30
Trisha Anand
02e5445731
[Mongo Plugin] Raw is now a command option instead of Form vs Raw (#5446)
* Raw is now a command option instead of Form vs Raw

* Added database migration for migration raw input type to be of raw command type

* Fixed test case failure

* Minor cleanup
2021-06-29 11:13:17 +05:30
Nidhi
57adbd7777
Schema info in templates query (#5244) 2021-06-18 11:31:17 +05:30
Trisha Anand
388418cec5
Merge the two update commands into a single update command in Mongo Form (#5171)
* Update commands have been merged into a single update command for both single and multi updates

* Added migrations to migrate any update one mongo form command to new update command

* Incorporated review comments
2021-06-18 11:04:39 +05:30
Trisha Anand
77e965523c
[Feature] Smart Substitution for JSON fields in Mongo Form (#5136)
* Reduced verbosity of the command names for Insert, Find and Delete

* WIP : Smart substitution untested changes for mongo form

* Tested code for smart substitution working for mongo form fields

* Added test case for assert for smart substitution
2021-06-16 13:31:00 +05:30
Trisha Anand
06cafb6066
Getting Prepared Statement for Postgres, MySQL, and MS-SQL and Smart Substitution for Rest API plugins out of beta (#5019)
* Correcting text for Mongo Form Insert command

* Getting Prepared Statement for Postgres, MySQL, and MS-SQL and Smart Substitution for Rest API plugins out of beta

* Fixed failing test case

* Fixed Ms-sql plugin test failure
2021-06-10 13:55:56 +05:30
Abhijeet
0246563bd2
Bugfix for applications with MongoDB datasources authenticated with SRV string (#4944)
* Avoid updating authenticationDTO for mongo-plugin with SRV if the authentication object is already present
2021-06-10 10:52:23 +05:30
Trisha Anand
1bb54b0c7c
[Bug Fix] : Mongo Form Find - Projection field is parsed correctly (#4976)
* Parsing the field projection in Mongo Form

* Added test case to assert Projection field working.
2021-06-08 19:27:55 +05:30
Trisha Anand
d5e5be5d6a
[Feature] Mongo Form (#4378) 2021-05-19 11:05:24 +05:30
Sumit Kumar
247e5d7ea4
Feature: return prepared stmt / smart substitution params under request params section for debugging (#4421)
- return prepared stmt / smart substitution params under request params section for debugging
2021-05-17 08:59:17 +05:30
Sumit Kumar
e74d99b794
fix NPE (#4448)
fix NPE
2021-05-13 11:59:43 +05:30
Sumit Kumar
0ec3604eac
Feature: connect to mongo db via connection string URI (#4131)
allow user to connect using a mongo connection string URI directly.
2021-05-10 10:35:45 +05:30
Sumit Kumar
52bfd25824
Feature: return request parameters with type for debug tab (#4078)
- return request parameters with type for debug tab.
- request params are stored in a RequestParamDTO object.
- a configProperty -> label map is cached in pluginService, which returns the param label as per the configProperty it is mapped to via editor.json file.
- This feature currently only works with prepared statements disabled.
2021-04-30 16:26:51 +05:30
Sumit Kumar
275843e61a
Fix: Return helpful error message when get structure fails for mongo db due to lack of read permission. (#4077)
- return helpful error message when get structure fails for mongo db due to lack of read permission. The message returned is: Appsmith has failed to get database structure. Please provide read permission on the database to fix this.
- any get structure error is also generically being caught by the getStrucuture method in DatasourceStructureSolution.java
- error msg and status code is now returned as part of DatasourceStructure object.
- ErrorDTO is used to store error info.
- ErrorDTO definition is moved to appsmith-interfaces package so that it can be used all packages.
- Other changes:
  - stop logging PLUGIN_GET_STRUCTURE_ERROR externally, as this error is mostly triggered by credentials error or -lack of read permission.
  - start logging PLUGIN_GET_STRUCTURE_TIMEOUT_ERROR externally, because this is not a user error.
2021-04-26 11:18:08 +05:30
Shrikant Sharat Kandula
2971324be6
Fix unable to connect to MongoDB without username (#4130) 2021-04-23 18:21:36 +05:30
Trisha Anand
dd00f51808
Type Migration for Plugins Part 2 : Migration of existing actions + revert hotfix for editor.json (#4085)
* WIP :  Migration of data type for smart substitution configuration

* Fixed the migration code. Also reverted editor.jsons  back to equality check after migrations of existing actions

* Only fetching actions for plugins which belong to supported plugins.

* Setting a default value of "false" for all the actions which don't have a valid configuration for smart substitution.

* Minor code formatting

* Minor language change in comment

* Removed debug logs
2021-04-22 12:07:25 +05:30
Trisha Anand
30a82c2d24
Hotfix for broken release. Would do a proper fix on release tomorrow with migration (#4075) 2021-04-20 18:54:34 +05:30
Trisha Anand
eeaa26a7cc
Type migration from String to Object for plugin specified templates to preserve boolean and any other future data types (#4053)
* WIP : Type migration from String to Object for value

* Migrating config from string to boolean for prepared statement.
Handled error for already stored actions where PS config is stored as String and not Boolean.
2021-04-20 16:09:48 +05:30
Trisha Anand
9b49308abe
Adding dependency relationship to plugins (#3997)
* Added dependencies to be added to dependencyMap on client to Postgres, MSSQL, MySQL and Mongo plugins

* Added Dependency config for API

* Fixed the test case
2021-04-15 11:36:41 +05:30
Sumit Kumar
9c8bce0415
Feature: return data types of returned data on query execution for better data display (#3914)
- Return data type list along with action execution result so that the data can be displayed in the correct format.
- Handles these three data types for now : table, json, raw.
  - If a plugin has already assigned the data type, then common handler is not used.
  - Mongo plugin assigns the data types in the plugin specific flow i.e. does not use the common data type parse / assign method.
- To address review comments:
  - added a new enum ActionResultDataType for data types. It is consumed by ParsedDataType. A list of ParsedDataType is returned by ActionExecutionResult
  - parsed data in parallel using streams.parallel().
2021-04-09 10:58:37 +05:30
Sumit Kumar
41e44eed30
Feature: add title to action execution errors to improve user experience (#3872)
- add title to action execution errors to improve user experience
    - all errors in AppsmithPluginErrors
    - action execution related errors in AppsmithError : NO_CONFIGURATION_FOUND_IN_DATASOURCE, INVALID_ACTION, INVALID_DATASOURCE, INVALID_DATASOURCE_CONFIGURATION - as these are the likely errors in an action execution flow (excluding plugin specific flow) that might result from faulty action / datasource configuration by a user.
    - title is returned as part of ActionExecutionResult.
    - title is set in ActionExecutionResult on failure during action execution.
    - In response to review comment - added a new BaseException class, so that both AppsmithException and AppsmithPluginException extend this base class. Also, refactored code to introduce setErrorInfo() function in ActionExecutionResult class to set its attributes.
- Some unrelated cleanup:
    - catch PoolInitializationException for Postgres plugin and return AppsmithPuginException
    - catch MongoTimeoutException and return AppsmithPluginException
2021-04-08 09:49:05 +05:30