Commit Graph

525 Commits

Author SHA1 Message Date
Shrikant Sharat Kandula
87f27c9182
Add two new/updated apps for self-hosted (#392)
* Add two new/updated apps for self-hosted

* Fix potential NPE when template org dump has API datasources
2020-08-21 14:37:35 +05:30
Shrikant Sharat Kandula
e97ceab412
Fix default page not being set for cloned applications (#383)
* Fix default page not being set for cloned applications

* Add test for setting default page in clone applications
2020-08-21 10:38:23 +05:30
Shrikant Sharat Kandula
27511c90d4
Users created won't have any orgs if a template is configured (#374) 2020-08-20 18:24:31 +05:30
Shrikant Sharat Kandula
3ae6c745b1
Initial implementation to import examples organization as a migration (#290) 2020-08-20 16:46:23 +05:30
Shrikant Sharat Kandula
bd670487a7
Redirect to forked application when signed up by clicking on Fork of a public example app (#335)
* Redirect to forked application works for direct login

Co-authored-by: Trisha Anand <trisha@appsmith.com>
2020-08-20 14:15:54 +05:30
Shrikant Sharat Kandula
f57e2a2fb8
Refactor: Remove unused type parameter in AnalyticsService (#340)
* Move repeated code for analytics into functions inside AnalyticsService

* Fix type parameters in BaseService & BaseController
2020-08-20 10:47:22 +05:30
Trisha Anand
efab105e19
Clone Page feature inside an application (#357)
* Working version of cloning page given page id. The clone is created inside the same application and is in unpublished state.

* Added a test case for Clone Page feature

* Incorporated review comments.
2020-08-19 15:20:00 +05:30
Trisha Anand
82018547f5
Added tests to test invite user permissions for administrators and developers and make public app permissions for only administrators. Also added test to ensure that roles for an organization are being returned depending on the current user's roles. (#326) 2020-08-18 10:53:46 +05:30
Trisha Anand
336514344b
If an invited user follows the path of reset password (instead of sign up), this should be allowed. (#328) 2020-08-17 14:57:41 +05:30
Shrikant Sharat Kandula
a79951bae9
Don't always automatically create a blank personal org (#306)
* Don't always automatically create a blank personal org

It will still be created, only if a example template organization
has not been configured in the system.

* Name examples organization same as personal organization

* Minor fixes in tests

* Remove unused userService in clone tests
2020-08-14 15:30:52 +05:30
Shrikant Sharat Kandula
50e8ee7255
Fix link in invite emails to point to signup page (#268)
* Fix link in invite emails to point to signup page

* Auto-fill email in signup page and remove CreatePassword component
2020-08-14 11:31:50 +05:30
Trisha Anand
52e7ed4f02
Bug Fix : When role changes from developer to admin, the user was not being given make application public permission for the application (#302)
* During add role to an organziation, the application was only inheriting from subset of the organization permissions. Generalized this code to ensure that this doesnt happen again in the future when more permissions are introduced. Refactored some code as well.
2020-08-13 18:53:00 +05:30
Arpit Mohan
10f462b229
Adding a test for the valid scenario when returning the plugin form details (#295)
We use @SpyBean annotation to partially mock the PluginService class.
2020-08-12 20:09:56 +05:30
Shrikant Sharat Kandula
368ed79f4b
Removed OPA config (#291)
* Removed OPA config along with the bundle and rules files
2020-08-12 16:52:42 +05:30
Shrikant Sharat Kandula
30c595678d
Set transient fields when loading application by id (#287) 2020-08-12 15:35:50 +05:30
Trisha Anand
c3c8e532c6
Updated the invite and make public app migration script more performant so that it takes lesser time on big db (#289)
* Updated the migration script to make more db queries instead of searching in the local app memory

* Permission correction.
2020-08-12 15:35:04 +05:30
Trisha Anand
7ee21456d5
Share Changes : Adding users to organization permission updates (#262)
* Introduced new permissions for making app public and inviting users.

* WIP : Returning a subset of roles depending on the current user's role

* Added code and tests for generating hierarchical children given a role name

* Get all invite roles now returns roles depending on the current users permissions (aka - admin can invite users for all roles, developers can invite users for roles develoeprs and below)

* When invite api is called, check if the user has correct permissions ( invite permission) and check if the role for which the users are bieng invited is allowed (aka the current user has the permission to invite for the said role)

* Introduced a new permission at application level which is inherited from manage:organizations. This new permission gives the administrator of the organization to make any application public .

* Incorporated review comments.

* Minor code changes.

* Added migration script to add the new policies introduced as part of this new share modal changes.

* Null pointer exception handled due to improper data in the database.

* Integration testing bug fixes.
2020-08-12 13:23:44 +05:30
Trisha Anand
a6496bd5af
Correcting the Docker image for Appsmith server for Github actions test (#260)
* Correcting the Docker image for Appsmith server for Github actions test

* Also fixing the bug where the datasource config is not returned properly for restapi-plugin

Co-authored-by: Arpit Mohan <arpit@appsmith.com>
2020-08-11 16:53:47 +05:30
Shrikant Sharat Kandula
115bff546c
Replace class-level generics with method-level in PolicyUtils (#257) 2020-08-11 14:07:52 +05:30
Shrikant Sharat Kandula
0c344115c3
Add transient field on applications to indicate whether it's an example application (#256)
* Add transient field on application to indicate whether it's an example

* Add test for marking of example applications

* Remove unused constant
2020-08-11 14:00:41 +05:30
Shrikant Sharat Kandula
dc10f09906
Fix organization cloning gets stale action IDs inside onLoad actions (#245)
* Fix organization cloning gets stale action ids for onload

* Fix test for onload action's organization after cloning
2020-08-11 13:58:50 +05:30
Trisha Anand
43d633f007
Setting role name while adding a user to an organizaiton. (#258) 2020-08-11 09:45:23 +05:30
Trisha Anand
d2442eb815
DO NOT MERGE: Bulk invite user to organization (#182)
* WIP: Not working bulk invite.

* WIP : Non compilable.

* Current test cases running.
TODO : Code Cleanup and write new test cases for bulk invite.

* Code cleanup

* Added a test case for bulk invite of users to an organization.

* Incorporated review comment.

* Merged the latest release and incorporated review comments.

* Corrected the error thrown when usernames is empty or null for invite user API.
2020-08-11 09:24:21 +05:30
Shrikant Sharat Kandula
25b752843f
Auto-login on signup (#201)
* Auto-login on signup works!

* Support form-encoded data body for signup requests

* Remove debug log entry when getting session

* Refactoring and add some docs to UserSignup solution

* Move user object construction to UserSignup solution

* Redirect with error message on signup errors
2020-08-10 14:59:56 +05:30
Shrikant Sharat Kandula
b511c3ada9
Change return type of plugin execution to be more specific (#247) 2020-08-10 14:41:32 +05:30
Trisha Anand
b5841e96d2
GET plugin form now returns json to render both datasource configuration form and the editor query pane (#199)
Keeping the function to read plugin resource generic for any type of resource. Now the parent function can also conditionally decide which plugin would require to read which resources from the filesystem.

Co-authored-by: Arpit Mohan <arpit@appsmith.com>
2020-08-03 16:37:28 +05:30
Shrikant Sharat Kandula
cef1241bcb
Return 200 when action could not be executed (#202) 2020-08-03 07:35:14 +05:30
Shrikant Sharat Kandula
43304ca146
Fix form data not showing up in the right place when importing from curl (#198) 2020-07-30 16:30:39 +05:30
Trisha Anand
c6a9fc2bb4
Organization getById should use custom repository get function (#195)
* Overwriting the base service's getById for OrganizationService to ensure that the response contains userPermissions (by using custom repository instead of default mongo repository classes)

* Fixed the failing test cases.

* Minor code formatting.
2020-07-29 16:57:46 +05:30
Arpit Mohan
4475bc2b1e
Configuring dynamic redirect post login (#194)
The client will have to send a query parameter redirectUrl or a header X-Redirect-Url in order for the server to redirect the client to the appropriate URL post login. If neither of these parameters are present, the client is redirected to /applications by default.

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2020-07-29 16:07:40 +05:30
Trisha Anand
eba38ae1fa
During signup, if the user already exists, instead of throwing a generic duplicate key exception, request the user to sign in. (#192)
* During signup, if the user already exists, instead of throwing a generic duplicate key exception, request the user to sign in.

* Minor change in the error message.
2020-07-29 13:44:23 +05:30
Shrikant Sharat Kandula
60efdb998b
Fix: Datasource password gets double encrypted on cloning (#191)
* Decrypt sensitive fields before cloning a datasource

* Fix NPE in cloning datasource when configuration is missing
2020-07-29 11:12:04 +05:30
Trisha Anand
9c51ac3f8d
🔥 & forget asynchronous email sending (#187)
* Email sending is now an asynchronous function. It follows a 🔥 & forget strategy to make it run asynchronously.
2020-07-28 20:06:12 +05:30
Shrikant Sharat Kandula
66bf23106d
Fix cloning fails in some cases for organizations (#159)
* Fix cloning fails in some cases for organizations

Cloning currently fails in cases like the following:
- Application with no pages
- Pages with no actions
- Pages with more than one action

* Remove debug naming of cloned datasources

* Add test for organization cloning

* Add more tests for organization cloning

* Fix potential race condition in adding pages to an application

* Move db update call to add page to application, into repository

* Use `getIdCriteria` to query for document's _id
2020-07-28 17:54:06 +05:30
Shrikant Sharat Kandula
74da0f117e
Reuse layout that's automatically created with page (#163)
* Reuse layout that's automatically created with page

* Use correct API for updating a layout

* Commenting out organization cloning test.

* Removed organization cloning test

* Adding a dummy commit to run the pipeline.

Co-authored-by: Arpit Mohan <arpit@appsmith.com>
2020-07-25 18:13:29 +05:30
Shrikant Sharat Kandula
10ad639b28
Bug/layouts not updated on action change (#161)
* Fix layouts not be updated when an action is updated

* Add test for updating onLoadActions when action updated

* Split layout and action test to separate class

* Remove duplicated test in ActionServiceTest
2020-07-25 16:45:42 +05:30
Shrikant Sharat Kandula
5ee1c24224
Fix layouts not be updated when an action is updated (#160)
* Fix layouts not be updated when an action is updated

* Add test for updating onLoadActions when action updated
2020-07-25 15:43:22 +05:30
Shrikant Sharat Kandula
4a269efd4a
Reset default fields of User object before update (#158)
The policies of `User` objects is an empty set by default. So, when using a new `User` object to call `update`, it also updates existing policies to be an empty list.
2020-07-24 18:32:43 +05:30
Trisha Anand
9f8b5ca4d8
Adding execute action permissions policy to match read actions policy in existing actions. (#156)
* Fixing test cases failing due to non unique names.

* Adding execute action permissions policy to match read actions policy in existing actions.

* Only save the action if there are read actions permission present (and hence could have been updated)
2020-07-24 17:05:49 +05:30
Trisha Anand
61c62c9212
Datasource Test should test against the datasource object sent by the client (#155)
* Datasource test should always test the latest object given by the client (instead of fetching the same from the db). If it is a saved datasource, then we should decrypt and set the password in the datasource (unless the password is one of the changes that is being tested).

* Added function level comment to clarify that this function can no longer be used by just sending the datasource.id field set.
2020-07-24 15:53:40 +05:30
Shrikant Sharat Kandula
23dd84d9c8
Clear application pages list before cloning (#154) 2020-07-24 14:35:16 +05:30
Shrikant Sharat Kandula
dfcabab4cc
Handle stale database connection from datasources (#151)
* Handle stale database connection from datasources

* Fix potential secondary case of stale connection error

* Fix Postgres to MySQL

* Move validity check timeout to a constant field

* Add test for recovery when stale connection error is thrown
2020-07-24 12:18:25 +05:30
Arpit Mohan
36bf14f221
Adding dynamic redirect to form & OAuth2 login (#149)
The client can send the redirect URL in X-Redirect-Url header. The server will honour the value set and redirect the client browser to this particular url. By default the server will redirect to /applications if the custom header is missing. The redirect url can either be absolute or relative.

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2020-07-23 20:32:38 +05:30
Trisha Anand
3c30b38937
Bug fix : External datasources do not execute for public application (#143)
1. Bug fix for when actions for a public application use an external datasource (aka db queries). The db queries were not getting executed because the permission for execute datasource was not getting set for anonymousUser.

2. When using the Test endpoint for datasource, if the datasource is being read from the db and there are encrypted fields, first decrypt the field and then send to the plugin for testing the co
2020-07-23 20:31:36 +05:30
Shrikant Sharat Kandula
fd888e33c8
Add migration for updating plugin doc links to our own docs (#142) 2020-07-22 15:28:27 +05:30
Arpit Mohan
690c327f2c
Adding default values for mysql datasource (#140)
Also correcting icon details to mysql plugin migration.
2020-07-22 14:00:15 +05:30
nupur
d0e60a1890
Mysql plugin integration (#53)
This commit adds the Mysql plugin to the Appsmith server. We also add a migration to ensure that this plugin is installed by default for all existing organizations. The migration also adds the plugin details into the DB.

Also adding the test cases for mysql plugin.

Co-authored-by: Arpit Mohan <arpit@appsmith.com>
Co-authored-by: Hetu Nandu <hetu@appsmith.com>
Co-authored-by: Arpit Mohan <me@arpitmohan.com>
Co-authored-by: Nupur Singhal <nupursinghal@Nupurs-MacBook-Air.local>
2020-07-21 16:01:42 +05:30
Shrikant Sharat Kandula
1fc582af08
When cloning examples organization, clone only public applications (#125)
* When cloning examples organization, clone only public applications

* Create template organization within the test

* Cleaned up test for cloning of examples organization

* Fix Mono chaning

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* Create test apps and config simultaneously

Co-authored-by: Trisha Anand <trisha@appsmith.com>
2020-07-21 13:39:07 +05:30
Trisha Anand
d1dd74018f
Bug fix : Update of datasource object leads to authentication field getting encrypted again. (#124)
* Datasource authentication object fields should only be encrypted during create or if the update object contains authentication object. Added a test case to check that update to any other field doesnt update the encrypted fields.

* Incorporated review comment
2020-07-21 10:53:03 +05:30
Shrikant Sharat Kandula
55a6cc6614
Clone examples organization for every new user (#78)
* Trying to clone the examples repo on new user signup

* Working implementation of cloning examples organization on user sign up

* Fix personal org not being created when template org is missing

* A working version of cloning of examples organization on first-login

* Add docs for methods in ExamplesOrganizationCloner

* Refactor computing user's first name into a method

* Add some menial tests for examples organization cloning

* Use explicit permissions when fetching applications and datasources

* Fix template organization config name hard-coding
2020-07-20 13:07:31 +05:30