* -fixed comment missing issue when user role is changed
* WIP: add test for policy utils
* -added test for policy utils comment permission when users are added or removed
* -removed unused code
* -removed public access modifier for an internal function
* -add test to verify comment thread policy updated when user role changed in organization
* -add tests for add user and remove user from organization to test comment thread policies
* -added API to and template for unsubscribe comment thread
* -changed public API url to make it sepratate from client public pages
-included the unsubscribe link to email body
* -made unsubscribe email notification API to private
* -added unsubscribe page
* -removed unused code
* Update app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Comments/UnsubscribeEmail_spec.js
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
* Update app/client/src/pages/common/UnsubscribeEmail.tsx
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
* Update app/client/src/pages/common/UnsubscribeEmail.tsx
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
* Update app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/BaseAppsmithRepositoryImpl.java
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
* -updated text as per lint error
* -updated text as per lint error
* -moved unsubscribe screen texts to messages.ts
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
* 1. For binary data in the response, base64 encoding the same before sending it out on the wire (instead of default conversion to string)
2. Added a new header which sets the data type of the response body.
* Minor code reformatting
* Fixed failing test cases
* The new header created should send the values in an array instead of a single value
* Refactor Page order API - Instead of the order filed use the Order persistency in Array offered by Mongo
* Add migration script to remove the order filed from the Application Pages
* Change unit tests as per the new implementation
* Fix indentation issues
* Compute pages based on the view mode
* Removed order field in response and changed the page order API response to List of pages instead of the application object
* Remove the Order filed from the Response class
* Use the $push instead of $addToSet to maintain order of pages in array
* Applied encryption for self-hosted instances username field, removed sensitive fields from request
* Request field added for Appsmith cloud instance
* Config variables moved to a central file
* API to run DB query using plugin specified templates
* Included get spreadsheet metadata in get info method
* Added TCs for checking Spreadsheet info response
* Added error message for invalid datasources
* Authentication check for datasource modified to AuthenticationStatus field
* resolved conflicts
* -fixed some issues in PR
* -used sequence in generating thread number
* -refactored the create thread method
* -refactored comment service
* -add bot reply to the first comment thread of an user
* -added a new bot thread when user resolves the first bot thread
* -handle the case when user data can be absent
* -add organization id and widget type to comment and comment threads
* -resolved conflicts
* -mark appsmith bot username as a tagged user in the bot comment
* -turn a private thread to a public thread when someone is tagged in it
* -updated as per the review comments
* -fixed compile error in unit test
* -updated as per PR review comments
* -removed commented code
* Adding support for explicit data type casting in postgres prepared statement
* Added text and int psql data types for support in explicit typecasting
* Documenting the code
The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system (#5788)
Co-authored-by: 王昆 <quincy@cloudtogo.cn>
* Add try catch block to handle the data conversion exception
* Suggest widget only in edit mode
* Add JsonNodeType to the widget suggestion logic
* Use ClassCastException instead of generic exception
* add tests for the array data type
* Suggest list of possible widgets instead of one
* Use constant in if condition to avoid possible NPE
Fix typo
* add support in Redis plugin to select database when creating db connection.
* refactor code to use URI string instead of constructor call, because of lack of appropriate constructor.
* add TCs.
* fix validate datasource.
* return hint message to user if the expected content type is json but the api response is not a valid json.
Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
* Call cloud services to fetch mock datasets
* Call cloud services to fetch mock datasets
* Change the MockData Config,
* Remove unused import statements and fix small indentation issues
* 1. Moved the mock data creation and fetching to a separate class
2. Added plugin type to mockdata class
3. Used pluginName to identify the db type
4. Removed the block call mock data creating method
5. Added unit tests for the mockdata
* 1. Removed unused field from contract and
2. Updated the url to cloud service
* 1. renamed the field of mockdata contract
2. Updated the test cases
* using new mock datasources apis
* 1. Added the Cloud Service release end point to env variable
Co-authored-by: Pranav Kanade <pranav@appsmith.com>
* Template application updated to include separate page for MongoDB as a datasource
* Support for mongoDB as datasource added
* Added comments
Co-authored-by: Nikhil Nandagopal <nikhil.nandagopal@gmail.com>
* -added new API to get unread comment thread count
* -changed query to get unread comments so that it only searches where user has permission
* -added unit test for unread comment thread count
* -improved formatting
* -updated as per PR review
* Changing application public/private view can no longer be cancelled (for example by client timeout, etc.)
* Update test to only read the datasource used in the application
* Incorporated review comment
* Comment update
* Add widget suggestion to query execution flow
* Change the logic for Chart widget suggestion
* Add tests for the all the suggested widgets
* Added enum class to store widget types
* WIP: updated the email template
* -updated the comment link in email as per the user role
* -rebased from release
* Update app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/EmailEventHandler.java
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
* -updated the template as per review comment
* -removed unused email template file
* -fixed compile error
* -checked application policy instead of role when sending email for comment
* -minor changes as per PR review comment
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
* Added an API to get list of mock datsets
Removed the flow of
* Removed the auto populate of mock datasets flow when the user sign up first time
* Fixed indentation issues
* Instead of sending empty datasource, change template value to empty
* Add only the configs to response instead of entire mongo doc
* Add API to create mock data set
* 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
* add api key based and bearer token based authentication options to REST API datasource
* this change is ported to release from Feature: datasource changes for api key auth, bearer token auth, combine config. #4683
* Keymapping, Clone actions from template application, Used exported application JSON file as template app
* Delete references of widgets from action config if extra widgets not required
* Separate API added when pageId is not present with the client
* Added TCs
* Update in regex, enable reqArgsConstructor, separate DTO for CRUD page
* -send email to users who are subscribed to a thread only
* -fixed null pointer exception while set subscriber in create thread
* -updated as per PR comments and review
* 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
* POC for snowflake integration with Appsmith
This is just a rough version to see if the functionality works. Needs to be cleaned up & enhanced for production usage.
* Plugin with connection, monos, ds testing, validation, templates, structure and forms
* Better comments
* Default schema to public
* Changed logging destination, populated request in result and used thread group for datasource creation
Co-authored-by: Arpit Mohan <arpit@appsmith.com>
* -added pagination to notifications API
* -add unit tests for notification pagination
* -added unread count in get notifications API
* -moved notification creations to notification service from comment service
* -add repository method to mark a notification as read
* -added repository to update isRead by for username
* -add API to mark notification as read
* -addd application id and application name in notification
* -save application id and name in notification when creating notification for comment and comment threads
* -added page id, from user information in notifications
* -fixed failing unit test due to dependency error
* -removed unused imports
* -extended base controller in notification controller
* - introduced pagination based on before created data instead of offset based pagination
* -moved application id, name and page id inside comment from notification
* -moved author information from notification to comment thread
* -return data from notification service instead of the response object in the mark read or unread API
* 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
* Added permission export:applications for admin role
* Only admins are allowed to export applications
Co-authored-by: Pranav Kanade <pranav@appsmith.com>
* 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
* [Issue #4572]-Added API to leave organisation by any user
[Issue #4572]-Add option for organization admins to leave an organization
* -add option to leave organization in frontend for non-admin users
* -updated the leave org endpoint path and HTTP method as per PR review
* Update app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserOrganizationServiceImpl.java
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
* Update app/server/appsmith-server/src/main/java/com/appsmith/server/services/UserOrganizationServiceImpl.java
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
* -add cypress test and some minor changes as per PR comment
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
* Decryption for dbauth, basic and OAuth datasources added in exported file
* All authentications for datasources included while exporting as deserialization is done through json file otherwise cast is throwing error
* Content-Disposition header implemented
* MongoEscapedWidget names segregated for published and unpublished layout, to prevent overwrite while exporting
* Published pages and actions explicitly handled in cases where unpublished resources are deleted
* fix socket error
* fix default port
* remove invalid check for missing port, since default port would be supplied if user leaves the port field empty.
* Handling multipart form data in the CURL import flow
* Adding Cypress test for curl import with multipart/form-data
* Also fixing minor bug where the form values need not always be double-quoted
* Add APIs for reacting and unreacting on comments
* Add tests for Reactions APIs
* Fix s/create/delete typo
Co-authored-by: Nidhi <nidhi@appsmith.com>
* Deletion is successful if more than one are deleted
Co-authored-by: Nidhi <nidhi@appsmith.com>
Because of the Java version not being explicitly set
in this plugin, the build of the whole project fails
sporadically in IntelliJ since it's trying to compile the
code as Java 8, which will obviously fail.
We were using PATCH, because that was semantically more
correct for what we are doing here. But since PUT is used
everywhere else in the project, changing this to PUT for
consistency.
- 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.
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
* Only consider headings till value grid size, but consider all values till this size
* Switched from null to blank for consistency
* Whoops, we don't do null row objects anymore
- 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.
* Fixed the migration script where actions with no default smart substitution configuration get the correct configuration of turned off
* Removed debug logs
* Stupid comment correction
* OrgId is added as a suffix to link datasource entry with orgId when creating document in sequenceDB.
* Each document entry in sequenceDB is linked to organization ID which is then used by the datasourceDB to generate default name. Testcase for testing default names to new datasources (#2212)
* Migration ChangeSet added to setup sequenceDB with organization ID in name field
* Optimization in string operation
* 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
* cherry pick -make new
* revert to enable fix from release
* attempt to hook into existing datasource editor
* gSheets plugin skeleton from Rest API
* Changes for database migration
* fix for auth code
* separate it out
* action page loads!
* add to explorer
* create action from datasource
* Editor JSON WIP
* working query form
* Editor JSON WIP
* import to
* fix toast message
* redirect from datasource and editor pages
* fix onboarding
* fix imports and constants
* refactor form out
* refactor queryForm
* Merge branch 'release' into feature/google-sheets
* Merge branch 'release' into feature/google-sheets
* initial values from settings, editor and form
* Check
* remove dangling code around lightTheme
* Safety net
* remove class
* try mouseover solve
* force click
* changes from review
* fix action form name on import
* Merge branch 'release' into feature/google-sheets
* minor cleanup
* Merge branch 'release' into feature/google-sheets
* WIP
* Google sheets changes
* Merge conflicts
* Merging and fixes, needs refactoring
* Check
* Merge branch 'release' into feature/google-sheets
* Fixed tests
* Add cloud services env variable
* Clean up saga
* Clean up
* Refactoring
* Deleted svg file
* Minor fixes
* Modified design to allow behaviour in google sheets methods (#3486)
* Modified design to allow behaviour in google sheets methods
* Review changes
* Removed sysout
* Added handling of edge cases with table data
* Merge branch 'release' into feature/google-sheets
* Fixes
* Fixes
* Added validations
* Improved tests
* Removed extraneous injected bean
* Review changes
* Fixed bug with method
* Changes to Google sheets plugin's request and response structures (#3692)
* Method changes
* Removed logging
* Renaming options
* Reverting pom version
* Modified type of collection variables, fixed errors
* Converted row offset field to one that supports dynamic bindings
* Review changes
* List SAAS plugin type actions under lightning menu apis (#3820)
* list saas plugin type actions under lightning menu apis
* combine saas plugin type actions in the other sub menu of lightning menu
Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
* Fix merge issues
* Prettified query editor and a few fixes w/ ux
* Test fixes
* Reformatting request
* code for REST added (#3876)
Co-authored-by: hetunandu <hetu@appsmith.com>
* Renamed body to row object
* Renamed placeholder for range
* Renamed range heading
* Modifications to handle range semantics
* Use spreadsheet Url instead of id
* Ordering of methods
* Removed logging
* Add tests for Dynamic text controls
* Add tests for url helpers
* Fix coverage config
* Nevermind
* Interface changes
* There is no body here
* Yay to hints
* Delete row field is separately handled as row index
* placeholder support (#4001)
* Fixed tests, typos and creating new sheets with random rows
* Switched to using 'rowIndex' throughout
* binding path added for query input field (#4016)
* - Fixed QA bugs (#4032)
- Split delete sheet into two
- Removed dynamic query input types from hidden keys
* Proper exceptions
* Removed extra logging
* Throw exception if update method does not match any of the columns
* Same for bulk update
* Zero-indexed delete row
* I'm a space bound rocket ship
* Logic to register installations with cs (#4062)
* Logic to register installations with cs
* Clean up
* Casting to string
* Checking to see if this makes the test pass
* Added an extra null check
Co-authored-by: Piyush <piyush@codeitout.com>
Co-authored-by: hetunandu <hetu@appsmith.com>
Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
* 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.
* New dto for refactoring action name which includes actionId as well
* Refactor action name now also takes actionId as payload and fetches the action from db by id instead of name to solve for the scenario where the action names could be duplicated.
* Adding actionId to QP of action refactor API.
* WIP : test for asserting the bug fix
* WIP test
* Fixed the test case asserting refactoring works for an action when there are duplicate action names in the page.
Co-authored-by: Ashok Kumar M <35134347+marks0351@users.noreply.github.com>
* Added organization slug to the invite Url, which is finally used by email template(#2359)
* Separate method to create email params. Welcome email url variable updated so as to be consistent with other email templates
* Unused enum emailType removed, importing of java.util.* removed as per suggestion
* 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
Maven 3.8 now blocks HTTP repositories and only allows HTTPS. However, the version redshift jdbc dependency we are using connects to a separate repository that runs on HTTP. The latest version has switched to using HTTPS instead.
So this PR upgrades redshift dependency from version 2.0.0.1 to 2.0.0.4.
Ref: https://maven.apache.org/docs/3.8.1/release-notes.html#cve-2021-26291
- 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().
- 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
* Annotation set up
* Removed annotation uses
* Redundant condition
* Commented out logging, retained for implementation
* Handling for Collection and Map parameterized types
* Removed comments
* Bug Fix : Escaping _id and _class from primary column keys before storing the DSL
* Fixed the test case failures.
* Updated the replacement strings for _id and _class to include appsmith keyword
* Feature : JSON Smart Substitution in Mongo Plugin
* Added BSON data type for Mongo substitution. Added test case
* Minor comment added
* Minor variable re-naming and correcting failing test cases.
* REST API : Escaping special characters in string before smart substitution
* Incorporated review comment