-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Toolpad docs part 1 #859
Changes from 7 commits
93edd16
e11ebb6
fa17eac
e2e1164
82c43e9
06125fa
7fe7093
dda114b
a025c12
839b85d
885af15
8149043
b9c595f
8be5391
07061d2
4bc3ac7
c9f5243
e2c7eee
e8a3f88
119adad
77317d5
a7324e8
5cbff47
d4650e7
9e5af85
c26f154
9d50238
485fb2f
b778598
5396b02
abf3e4b
127fec3
f1a8f12
2db048f
1e9a3aa
8bd44ee
b49dc62
3c1d220
e824a7f
1127c70
2e404a0
8a90980
730b190
8fa01fe
b635af5
0b5308b
b0b76b3
945091c
e408e64
dcf0e4c
0998097
84e1269
b0e3eb4
698e87a
d61ceff
d5a988b
3bcdb0c
cf73a8e
d0949da
3f866f0
f1a2ec2
2842b95
bcd2761
b799c6d
fb10be0
adc4ee1
a94d00c
29763b4
6e003c9
9251b05
12f3e7a
093262d
c34be07
4a255d2
b1ddd40
21bc42d
22152a9
582bdc7
20215ad
fa2f327
908f39e
45964db
0ff649c
12bf5dc
d9c5875
efd45d2
1f91153
58bd598
ee3af2b
ed6be09
4095fb0
799a3bd
9826092
d2b6d07
e118af0
8ca3736
abe16ed
c000a38
7b60f7f
8d3a211
f029330
0be71aa
3b50780
6bf8f1b
0696dd1
c421eb1
f4d0a40
07cb121
a55beff
11c548b
f085113
1d685f4
8db5b30
fa4c4a6
78dbade
5184b69
522a623
6bbc4c8
3fd051b
3916548
ebe9953
c919a26
7ce4dac
4ceb100
b1e8e4f
e2e3a8f
e0746df
2019991
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Connections | ||
|
||
<p class="description"> | ||
<b>CONNECTION</b> instance allows us to reuse certain configuration details to create <b>queries</b> faster | ||
</p> | ||
|
||
In order to create a new `CONNECTION` instance press `+` button in the `Instance editor` on the left | ||
bytasv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
![Add Connection](/static/toolpad/connection.png) | ||
|
||
## Connection types | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In terms of organizing the information, I wonder if it makes sense to group more by datasource. e.g. instead of:
More towards
It's just a bit strange that if I want to set up a postgres query, I'd have to visit two different pages. First I have to find the postgres section in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason why I split them up initially is that it's how it's currently done in the app itself. We do have 2 separate concepts - connection and datasource. I don't really see what we could put as a shared content for |
||
|
||
There are 2 query types that **do not require** `CONNECTION` instance: | ||
|
||
1. [Function](/toolpad/connecting-to-data-sources/function/) type | ||
|
||
![Connection function](/static/toolpad/connection-function-1.png) | ||
|
||
We can define `Secrets` (key/value) that we can later access in the `Function` type `query` | ||
|
||
![Connection function](/static/toolpad/connection-function-2.png) | ||
|
||
1. [Fetch](/toolpad/connecting-to-data-sources/fetch/) type | ||
|
||
![Connection fetch](/static/toolpad/connection-fetch-1.png) | ||
|
||
We can configure: | ||
|
||
- `base url` - url that can be shared between different types of queries | ||
- `Headers` - pass custom headers with each request | ||
- `Authentication` type - if your API is protected choose authentication method that fits your needs: | ||
- `Basic` - adds `Authorization` header and generates **base64** encoded value for a given user credentials | ||
- `Bearer token` - adds `Authorization` header generates value for provided token | ||
- `API key` - adds key/value header | ||
|
||
There are 2 types that **require** `CONNECTION` instance: | ||
|
||
1. [Google Sheets](/toolpad/connecting-to-data-sources/google-sheets/) type | ||
|
||
1. [Postgres](/toolpad/connecting-to-data-sources/postgres/) type | ||
|
||
In order `query` data from `postgres` database we **must** configure connection | ||
|
||
![Connection postgres](/static/toolpad/connection-postgres-1.png) | ||
|
||
Provide database credentials and `TEST CONNECTION` to verify that we are able to connect | ||
|
||
If everything is correct `SAVE` and you will be able to use [Postgres](/toolpad/connecting-to-data-sources/postgres/) queries |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Fetch | ||
|
||
<p class="description"> | ||
<b>Fetch</b> query type is an easiest and fastest way to load external data within Toolpad app | ||
</p> | ||
bytasv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
As explained in the [connections](/toolpad/connecting-to-data-sources/connections/) section you can either create a reusable `connection` or simply create a new `query` and put all connection details inline | ||
|
||
1. Choose `ADD QUERY` in the `Properties editor` on the right | ||
|
||
1. Select `Fetch` type and click `CREATE QUERY` | ||
|
||
![Fetch type](/static/toolpad/fetch-query-1.png) | ||
oliviertassinari marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. We got all the basic configuration settings as described in [queries](/toolpad/connecting-to-data-sources/queries/) section | ||
|
||
1. In addition we can configuration following properties inline | ||
|
||
![Fetch configuration](/static/toolpad/fetch-query-2.png) | ||
|
||
- `parameters` - allows us to use [data bound](/toolpad/data-binding/) properties which can then be used construct dynamic `url` value | ||
- `HTTP method` - by default `GET` is used, but we also support `POST`, `PUT`, `DELETE`, `PATHC` and `HEAD` methods | ||
- `url` - is an endpoint to which requests will be made. We also have an option to dynamically generate `url` by using [data binding](/toolpad/data-binding/). `Parameters` can be accessed by using `query` object inside `url` `data binding` editor | ||
|
||
![Dynamic url](/static/toolpad/fetch-query-3.png) | ||
|
||
1. Knowing that data comes in a different shapes we provide an easy way to `transform response` | ||
|
||
- Simply enable option by checking `Transform response` | ||
- Then modify which properties of `data` object should be returned as a final response | ||
|
||
![Transform response](/static/toolpad/fetch-query-4.png) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,34 @@ | ||||||
# Queries | ||||||
|
||||||
<p class="description"> | ||||||
Toolpad allows us to easily connect to external data sources and render dynamic data. The easiest way to do so is to create a new <b>QUERY</b> which can be used to fetch data | ||||||
</p> | ||||||
|
||||||
1. Locate `ADD QUERY` button in the `Properties editor` on the right | ||||||
|
||||||
![Query](/static/toolpad/query-1.png) | ||||||
|
||||||
2. There are currently **4 different types\*** that can be used to fetch data: | ||||||
|
||||||
![Query types](/static/toolpad/query-2.png) | ||||||
|
||||||
- [Function](/toolpad/connecting-to-data-sources/function/) - advanced fetching methods which gives a lot of freedom by allowing to write custom fetching code | ||||||
- [Fetch](/toolpad/connecting-to-data-sources/fetch/) - basic, but very powerful. Just pass URL of an API endpoint and you are ready to query your data | ||||||
- [Google Sheets](/toolpad/connecting-to-data-sources/google-sheets/) - allows accessing data from your `Google sheet` document | ||||||
- [Postgres](/toolpad/connecting-to-data-sources/postgres/) - ability to hook directly into your own DB without the need to use API | ||||||
|
||||||
\* - by default you will see only `Function` and `Fetch` types, for `Google Sheets` and `Postgress` you will first need to create a [`CONNECTION` instance](/toolpad/connecting-to-data-sources/connections/) | ||||||
|
||||||
3. After choosing the `QUERY` type and clicking `CREATE QUERY` you will be presented with a query configuration dialog (configuration settings for each individual type are documented on their respective pages). | ||||||
Janpot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
There are a few configuration options that are applicable to every `QUERY` type: | ||||||
|
||||||
![Query configuration](/static/toolpad/query-3.png) | ||||||
|
||||||
- `Refetch on window focus` - execute the query every time the window is focused to make sure you always have the latest data visible | ||||||
- `Refetch on network reconnect` - execute the query every time the network status changes | ||||||
- `Refetch interval` - you can configure the query to run on an interval, e.g. every **30s**. To disable this option, keep the field empty | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I noticed there's a lot of punctuation missing, especially in unordered lists. I quickly glanced over the core docs and there it seems lists do have punctuation. |
||||||
|
||||||
## What's next? | ||||||
|
||||||
[Learn all about](/toolpad/connecting-to-data-sources/connections/) `CONNECTIONS` so you can use all `QUERY` types | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To make links as self describing as possible, best to include the subject in it. I'd do
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Data binding | ||
|
||
<p class="description"> | ||
Data binding is a widely used concept inside Toolpad app which allows us to connect various parts of the application and make them dynamically react to data changes | ||
</p> | ||
|
||
## Binding button | ||
|
||
In order to initiate `data binding` look around in the UI for a binding button | ||
bytasv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
![Binding icon](/static/toolpad/data-binding-1.png) | ||
|
||
The easiest way to tell if a value can be "data bound" is by locating binding button, i.e. `TextField` component allows us to bind every property that we could otherwise control manually | ||
|
||
![Binding example](/static/toolpad/data-binding-2.png) | ||
|
||
## Binding editor | ||
|
||
Upon clicking `binding button` we will be presented with `binding editor` which allows us to define `JavaScript` expression. | ||
|
||
At the top of the editor we can see an explanation what **type** of property we expect to be defined (i.e. above mentions `string`). | ||
|
||
![Binding editor](/static/toolpad/data-binding-3.png) | ||
|
||
On the left side of the editor we have a list of all the `variables` in the `scope` that can be used to define the expression. | ||
|
||
We can either simply pass a `path` to a property of the `object` or we can also use any other `JavaScript` expression or code snippet to additionally process the value that is going to be used. | ||
|
||
![Binding custom expression](/static/toolpad/data-binding-4.png) | ||
|
||
All that's left is to click `UPDATE BINDING` and we can observe how application behaves | ||
|
||
(In this example we bound value of `TextField` to the value of `Typography` component) | ||
|
||
Empty field: | ||
|
||
![Binding result 1](/static/toolpad/data-binding-5.png) | ||
|
||
Field with value: | ||
|
||
![Binding result 2](/static/toolpad/data-binding-6.png) | ||
|
||
## Global scope variables | ||
|
||
Sometimes we might want to define our `custom variables` that could be used for `data binding` in order to do that we can use `EDIT PAGE MODULE` functionaly that can be found in the `properties editor` on the right | ||
|
||
![Edit page module](/static/toolpad/data-binding-7.png) | ||
|
||
We will be presented with an editor where we can define any number of variables | ||
|
||
![Global scope](/static/toolpad/data-binding-8.png) | ||
|
||
Once we `SAVE` our changes we can use those variables to bind value of any property | ||
|
||
![Global variable in the editor](/static/toolpad/data-binding-9.png) |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Introduction | ||
|
||
## What is Toolpad? | ||
|
||
<p class="description"> | ||
Quickly build internal tools. MUI Toolpad is a self-hosted low-code internal tools builder designed to extend the MUI React components. It's designed for developers of all trade who want to save time building internal applications. | ||
</p> | ||
bytasv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Learn a few core concepts of the Toolpad app and you are ready to ship your application in minutes! Drag & drop built-in UI components, connect your data sources, release your app - and you're done! | ||
|
||
![Editor screenshot](/static/toolpad/hero-screenshot.png) | ||
|
||
## How Toolpad works? | ||
|
||
- [Build UI](/toolpad/core-concepts/building-ui/) using our drag & drop editor | ||
- [Configure and fetch](/toolpad/core-concepts/connecting-to-data-sources/) data from HTTP endpoints, Google sheets or even directly from Postgres SQL DB | ||
oliviertassinari marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Connect data with UI elements using [binding expressions](/toolpad/core-concepts/data-binding/) | ||
- When you are ready to share - [deploy](/toolpad/core-concepts/versioning-and-deploying/) a new version | ||
|
||
## See it in action | ||
|
||
TODO: embed our demo video from landing page? | ||
|
||
## What's next? | ||
|
||
[Try to build your first app](/toolpad/getting-started/quickstart/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the "type" nomenclature. But perhaps "Fetch datasource" is too long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna update it all across docs 👍