Commit Graph

784 Commits

Author SHA1 Message Date
Nidhi
39bb0ac805
Removed prod url from default config (#4377) 2021-05-07 23:22:20 +05:30
Shrikant Sharat Kandula
3b3e24f8cf
Add delete thread API (#4363) 2021-05-07 15:58:02 +05:30
Shrikant Sharat Kandula
8c7e844d80
Accept PUT requests for thread updates (#4357)
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.
2021-05-07 14:02:41 +05:30
Shrikant Sharat Kandula
1f2f5ec227
Fix ACL not applied on editing comments (#4351) 2021-05-07 12:35:53 +05:30
Trisha Anand
f7d3beef50
Added success log when the email is sent out successfully. (#4233) 2021-05-06 16:27:17 +05:30
Trisha Anand
aa51040c99
Small housekeeping server side changes (#4245)
* Minor refactor datasource policy generation for easy re-use.

* Added simple widget name refactor test
2021-05-06 16:27:08 +05:30
Snyk bot
bf81709492
fix: upgrade org.hibernate.validator:hibernate-validator from 6.0.18.Final to 6.2.0.Final (#4307)
Snyk has created this PR to upgrade org.hibernate.validator:hibernate-validator from 6.0.18.Final to 6.2.0.Final.

See this package in Maven Repository:
https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator/

See this project in Snyk:
https://app.snyk.io/org/nikhil-nu4/project/b1eb6091-e23c-476f-bcc4-c4ae240497f8?utm_source=github&utm_medium=upgrade-pr
2021-05-06 16:23:37 +05:30
Nidhi
6c0668e74d Tests for encryption 2021-05-06 13:36:37 +05:30
Nidhi
b2aaa7787c Merge branch 'release' of github.com:appsmithorg/appsmith into task/apply-encryption 2021-05-06 12:55:25 +05:30
Sumit Kumar
1286af4285
fix for NPE (#4288) 2021-05-04 18:39:45 +05:30
Nidhi
e855123542
DB change for SAAS editor UI component (#4268) 2021-05-04 00:05:48 +05:30
Shrikant Sharat Kandula
d950aeca22
Check for error class type before casting (#4256) 2021-05-03 16:13:26 +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
Shrikant Sharat Kandula
0895c68f1f
Send time information in comments and threads even from RTS (#4235)
* Include time information in comments from RTS

* Fix ISO formatting missing Z suffix
2021-04-30 15:32:34 +05:30
Rishabh Saxena
a0d2e8533d
Initialise comments (#3328)
* 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>
2021-04-29 16:03:51 +05:30
Trisha Anand
9884135cb7
NPE check when there are no mongo escaped widgets (#4200) 2021-04-28 22:27:01 +05:30
Trisha Anand
73c2b09dc4
[Bug Fix] : In case the table being renamed has mongo escaped fields, rename the table name in set keeping a track of these widgets as well (#4195) 2021-04-28 17:36:30 +05:30
Nidhi
8afac888c7 Merge branch 'release' of github.com:appsmithorg/appsmith into task/apply-encryption 2021-04-26 13:30:49 +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
Abhijeet
c11dab9673 Auto-generated-organization field added in organization DB to differentiate between user created and auto generated organization 2021-04-23 19:29:20 +05:30
Trisha Anand
432b365980
[Hotfix] Fixed the migration script where actions with no default smart substitution configuration get the correct configuration of turned off (#4122)
* 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
2021-04-23 17:36:31 +05:30
Abhijeet
bb0516a495
Default counter for new datasource in organization should initiate at 1 (#4005)
* 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
2021-04-22 12:46:43 +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
Abhijeet
005e00a8a8
Added new analytics datapoint to capture invite users event (#4095)
New analytics datapoint added to capture event : invite users to organisation
2021-04-22 10:59:47 +05:30
Nidhi
6b31aa333b
Introducing Google Sheets Plugin (#3517)
* 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>
2021-04-22 09:00:09 +05:30
Nidhi
963d1225dc
Reverting use of Mongo Listener since we aren't applying this yet (#4073)
* Added synchronization to encryption map

* Reverting listener for now
2021-04-20 13:58:59 +05:30
Trisha Anand
f1253074a8
Added null check for NPE handling in sanitize datasource (#4072) 2021-04-20 13:13:22 +05:30
Trisha Anand
eaa24ca894
[Bug Fix] : Fetch actions by id during refactor action name to solve IncorrectResultSizeDataAccessException for pages where duplicate action names exist (#4030)
* 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>
2021-04-19 12:35:10 +05:30
Trisha Anand
4f8cf79041
[Bug fix] : Disallowing action creation with existing names from the page (#4015) 2021-04-16 16:13:03 +05:30
Abhijeet
6ea795e8a1
Autoscroll to invited organisation (#3945)
* 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
2021-04-15 16:46:46 +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
Shrikant Sharat Kandula
a259dd00ed
Fix internal server error on invalid header in curl command (#3931)
* Fix internal server error on invalid header in curl command

* Add tests for invalid header/method
2021-04-14 10:44:43 +05:30
Sumit Kumar
b4e43798ab
fix NPE by adding null check conditional (#3989)
Fix NPE seen on Sentry by adding null check for result body
2021-04-13 19:58:40 +05:30
Nidhi
a24eb90091
Fixed escaped layout being used for update (#3968)
* Fixed escaped layout being used for update

* Few more cases of unescaped layout usage
2021-04-13 09:36:50 +05:30
Nidhi
4bddfa0a4e
Fixed curl import without valid tokens (#3933) 2021-04-09 14:03:53 +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
Nidhi
4f68d5f472 Logging test failure 2021-04-08 19:53:48 +05:30
Nidhi
13a3e8f240 Applying AOP encryption 2021-04-08 16:58:45 +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
Trisha Anand
174ef284f0
[Bug Fix Improvement] : Table widget keys are unescaped after walking through the DSL (#3908)
* WIP : untested

* Minor refactoring

* Added test case to assert escaping and unescaping of the table widget primary column keys
2021-04-07 19:36:37 +05:30
Nidhi
927a6a3479
Annotation based encryption (#3610)
* Annotation set up

* Removed annotation uses

* Redundant condition

* Commented out logging, retained for implementation

* Handling for Collection and Map parameterized types

* Removed comments
2021-04-07 15:27:36 +05:30
Trisha Anand
4bf74f6434
Bug Fix : Escaping _id and _class from Table PrimaryColumn keys before storing the DSL (#3887)
* 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
2021-04-07 13:21:18 +05:30
Sumit Kumar
3140e98146
modify hint message to include fix (#3829)
Modify hint message to include fix.
2021-04-01 17:10:30 +05:30
Shrikant Sharat Kandula
efec01344a
Clone explicitly set datasource for new users (#3793) 2021-04-01 12:44:44 +05:30
Nidhi
9f8cb59a04
Null handling for bad state in OAuth2 callback (#3810)
* Null handling for bad state in OAuth2 callback

* Handling null

* Another case for when state is present but not as expected
2021-04-01 10:41:11 +05:30
Trisha Anand
aab75bf304
Bug fix : App viewer inviting another app viewer would assign correct permissions to applications 2021-03-30 17:05:44 +05:30
dependabot[bot]
00477fe686
Bump guava from 28.1-jre to 29.0-jre in /app/server/appsmith-server (#3728)
Bumps [guava](https://github.com/google/guava) from 28.1-jre to 29.0-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 00:20:04 +05:30
Nidhi
683176fc48
Increased default limit for webclient payload (#3718)
* Increased default limit for webclient payload
2021-03-26 21:34:10 +05:30
Sumit Kumar
e347b61e53
Return hint on localhost url (#3611)
- Return hint for localhost URL on the following events:
Test datasource
Save datasource
Update REST API Url
Create datasource from REST API
When page gets loaded for first time.
- Hint message returned: "You may not able to access your localhost if Appsmith is running inside a docker container or on the cloud. Please check out Appsmith's documentation to understand more."
- It has been decided as part of actions pod meeting that these messages will not be persisted.
2021-03-26 15:42:34 +05:30
Trisha Anand
ed1a0b4045
Refactor the smart substitution code to extract common code at plugin interface level. (#3497) 2021-03-25 19:10:42 +05:30