Skip to content

Commit

Permalink
Merge branch 'release/v0.5.7' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Navaneeth-pk committed Jun 12, 2021
2 parents 205c156 + 6e876f0 commit f89814e
Show file tree
Hide file tree
Showing 58 changed files with 710 additions and 362 deletions.
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: 🐜 Bug report
about: If something isn't working 🔧
labels: 'bug, needs triage'
---

### Version Information

### Environment
<!--
ToolJet Cloud / Docker / Linux / MacOS ...
-->

### What is the expected behavior?
<!--
Provide a clear description of what you want to happen.
-->

### What is the current behavior?
<!--
Provide a clear description of what is the current behavior.
-->

### How to reproduce the issue?

1.
2.
3.

### Screenshots or Screencast
<!--
Providing relevent Screenshots/ Screencasts would help us to debug the issue quickly.
-->

### Please provide any traces or logs that could help here.


### Any possible solutions?


### Can you identify the location in the driver source code where the problem exists?


### If the bug is confirmed, would you be willing to submit a PR?
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/02-feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: 🚀 Feature request
about: Suggest an idea for improving ToolJet
labels: 'feature request, needs triage'

---

### Is your proposal related to a problem?

<!--
Provide a clear and concise description of what the problem is.
For example, "I'm always frustrated when..."
-->

(Write your answer here.)

### Describe the solution you'd like

<!--
Provide a clear and concise description of what you want to happen.
-->

(Describe your proposed solution here.)

### Describe alternatives you've considered


(Write your answer here.)

### If the feature is approved, would you be willing to submit a PR?
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ❓ Get Support from Slack Community
url: https://join.slack.com/t/tooljet/shared_invite/zt-r2neyfcw-KD1COL6t2kgVTlTtAV5rtg
about: Please ask and answer questions here. 🏥
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.7.2
ruby-2.7.3
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ ToolJet is an **open-source no-code framework** to build and deploy internal too
</kbd>
</p>

<a href="https://www.producthunt.com/posts/tooljet?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-tooljet" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=298959&theme=dark" alt="ToolJet - Open-source alternative for Retool | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>


## Features

- Visual app builder with widgets such as tables, charts, modals, buttons, dropdowns and more
- Mobile &desktop layouts
- Mobile & desktop layouts
- Connect to databases, APIs and external services
- Deploy on-premise ( supports docker, kubernetes, heroku and more )
- Granular access control on organization level and app level
Expand Down
3 changes: 1 addition & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
},
"formation": {
"web": {
"quantity": 1,
"size": "FREE"
"quantity": 1
}
},
"image": "heroku/ruby",
Expand Down
4 changes: 3 additions & 1 deletion app/commands/authenticate_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def call

def user
user = User.find_by_email(email)
return user if user && user.authenticate(password)
org_user = OrganizationUser.where(user: user, organization: user.organization)&.first

return user if user && user.authenticate(password) && org_user.active?

errors.add :user_authentication, 'invalid credentials'
nil
Expand Down
5 changes: 5 additions & 0 deletions app/commands/authorize_api_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ def call
def user
@user ||= User.find(decoded_auth_token[:user_id]) if decoded_auth_token
@user || errors.add(:token, 'Invalid token') && nil

org_user = OrganizationUser.where(user: @user, organization: @user.organization)&.first
@user = nil unless org_user.active?

@user || errors.add(:token, 'Archived user') && nil
end

def decoded_auth_token
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/authentication_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def authenticate

if command.success?
user = User.find_by email: params[:email]

render json: { auth_token: command.result, first_name: user.first_name, last_name: user.last_name,
email: user.email }
else
Expand All @@ -27,7 +28,7 @@ def signup

org_user = OrganizationUser.create(user_id: user.id, organization_id: org.id, role: "admin")

# UserMailer.with(user: user, sender: @current_user).new_signup_email.deliver if org_user.save
UserMailer.with(user: user, sender: @current_user).new_signup_email.deliver if org_user.save
end
end
end
16 changes: 14 additions & 2 deletions app/controllers/organization_users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# frozen_string_literal: true

class OrganizationUsersController < ApplicationController
before_action :authorize_org_user, except: :create
attr_reader :org_user

def create
authorize OrganizationUser

Expand Down Expand Up @@ -31,8 +34,17 @@ def create
end

def change_role
org_user = OrganizationUser.find params[:organization_user_id]
authorize org_user
org_user.update(role: params[:role])
end

def archive
org_user.update(status: "archived")
end

private

def authorize_org_user
@org_user = OrganizationUser.find params[:organization_user_id]
authorize org_user
end
end
2 changes: 1 addition & 1 deletion app/controllers/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

class OrganizationsController < ApplicationController
def users
@org_users = OrganizationUser.where(organization: @current_user.organization).includes(:user)
@org_users = OrganizationUser.not_archived.where(organization: @current_user.organization).includes(:user)
end
end
2 changes: 2 additions & 0 deletions app/models/organization_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class OrganizationUser < ApplicationRecord
belongs_to :organization
belongs_to :user

enum status: { active: "active", archived: "archived", invited: "invited" }

def admin?
role == "admin"
end
Expand Down
4 changes: 4 additions & 0 deletions app/policies/organization_user_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ def create?
def change_role?
(user.organization_id === organization_user.organization_id) && user.org_admin?
end

def archive?
change_role?
end
end
2 changes: 2 additions & 0 deletions app/services/postgresql_query_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def create_connection
host: source_options['host'],
port: source_options['port']
)

connection.type_map_for_results = PG::BasicTypeMapForResults.new connection

cache_connection(data_source, connection)

Expand Down
2 changes: 1 addition & 1 deletion app/services/restapi_query_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(data_query, data_source, options, source_options, current_user)

def process
url = options['url']
method = options['method']
method = options['method'] || 'GET'
headers = (options['headers'] || []).reject { |header| header[0].empty? }
headers = headers.to_h
body = options['body']
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

TOOLJET_VERSION = '0.5.4'
TOOLJET_VERSION = '0.5.7'

module ToolJet
class Application < Rails::Application
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
end

resources :organization_users, only: [:create] do
post '/archive', to: 'organization_users#archive'
post '/change_role', to: 'organization_users#change_role'
end

Expand Down
2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

org = Organization.create(name: 'My organization')
user = User.create(first_name: 'The', last_name: 'Developer', email: 'dev@tooljet.io', password: 'password', organization: org)
OrganizationUser.create(user: user, organization: org)
OrganizationUser.create(user: user, organization: org, role: 'admin')
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ services:
- RAILS_ENV=development
- DB_PASSWORD=postgres
- DB_HOST=postgres
entrypoint: ["bash", "/app/docker/entrypoints/server.sh"]
command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"]

postgres:
Expand Down
7 changes: 7 additions & 0 deletions docker/entrypoints/server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

rake db:create
rake db:migrate

exec "$@"
2 changes: 2 additions & 0 deletions docker/server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ RUN gem install bundler && RAILS_ENV=production bundle install --jobs 20 --retry
ENV RAILS_ENV=production

COPY . ./

RUN ["chmod", "755", "docker/entrypoints/server.sh"]
4 changes: 2 additions & 2 deletions docs/docs/contributing-guide/setup/Mac OS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Follow these steps to setup and run ToolJet on Mac OS. Open terminal and run the

### Install Ruby using RVM
```bash
$ rvm install ruby-2.7.2
$ rvm use 2.7.2
$ rvm install ruby-2.7.3
$ rvm use 2.7.3
```

### Install Node.js
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/contributing-guide/setup/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $ docker-compose build

4. ToolJet server is built using Ruby on Rails. You have to reset the database if building for the first time.
```bash
$ docker-compose run rails db:reset
$ docker-compose run server rails db:reset
```

5. Run ToolJet
Expand All @@ -52,7 +52,7 @@ $ docker-compose up
1. Open rails console using:

```bash
$ docker-compose run rails console
$ docker-compose run server rails console
```

2. Create a new organization
Expand Down Expand Up @@ -80,12 +80,12 @@ $ docker-compose down
To run all the tests

```bash
$ docker-compose run rails test
$ docker-compose run server rails test
```

To run a specific test
```bash
$ docker-compose run rails test <path-to-file>:<line:number>
$ docker-compose run server rails test <path-to-file>:<line:number>
```

## Troubleshooting
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/contributing-guide/setup/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Follow these steps to setup and run ToolJet on Ubuntu. Open terminal and run the

### Install Ruby using RVM
```bash
$ rvm install ruby-2.7.2
$ rvm use 2.7.2
$ rvm install ruby-2.7.3
$ rvm use 2.7.3
```

### Install Node.js
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/deployment/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ToolJet have two main components: ToolJet Server and ToolJet Client.
2. Email service (SMTP/Sendgrid/Mailgun/etc) - Required to send user invitations and password reset emails.

2. ToolJet Client
ToolJet client is a ReactJS application. Client is responsble for visually editing the applications, building & editing queries, rendering applications, executing events and their trigger, etc.
ToolJet client is a ReactJS application. Client is responsible for visually editing the applications, building & editing queries, rendering applications, executing events and their trigger, etc.

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/deployment/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 6

# Deploying ToolJet client

ToolJet client is a standalone application and can be deployed on static website hostign services such as Netlify, Firebase, S3/Cloudfront, etc.
ToolJet client is a standalone application and can be deployed on static website hosting services such as Netlify, Firebase, S3/Cloudfront, etc.

## Deploying ToolJet client on Firebase

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ToolJet has just 3 fundamental principles to build apps:

- **Connect to data sources:** Connect to your existing data sources such as PostgreSQL, MySQL, Firestore, Stripe, Google Sheets and more.
- **Build queries:** ToolJet comes with query builders for all supported data sources. You can also use JS code to transform the query results.
- **Customise widgets:** Widgets are the UI components that can be edited using ToolJet's visual app builder. Widgets has events such as onClick, onRowSelected etc.
- **Customise widgets:** Widgets are the UI components that can be edited using ToolJet's visual app builder. Widgets have events such as onClick, onRowSelected etc.

ToolJet binds together the data sources, queries and widgets to convert business logic into apps.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorial/building-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Enable this option to show a prompt to confirm the action before a query is run.
<img src="/img/tutorial/building-queries/confirm.png" alt="ToolJet - Redis connection" height="120"/>

#### Show notification on success
Enable this option to show a custom message on query completion. Durationof the notification can also be set.
Enable this option to show a custom message on query completion. Duration of the notification can also be set.
2 changes: 1 addition & 1 deletion docs/docs/tutorial/sharing-and-deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Click on the share button on top right corner of the app builder to add new app
If you want the application to be publicly accessed without authentications, make the application public using the same prompt.

:::tip
Unauhenticated users will not have edit access to the public apps.
Unauthenticated users will not have edit access to the public apps.
:::

<img class="screenshot-full" src="/img/tutorial/sharing/public.gif" alt="ToolJet - Query result transformations" height="420"/>
Expand Down
Loading

0 comments on commit f89814e

Please sign in to comment.