Skip to content

Pagination #47

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

Merged
merged 4 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fern/docs/pages/pagination.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
A lot of the time, when you're making calls to the DevRev API, there'll be a lot of results to return. For that reason, we paginate the results to make sure responses are easier to handle.
DevRev API uses a cursor-based pagination to provide consistency and support large data.
Let's say your initial call is asking to list all the users in an org; the result could be a massive response with hundreds of thousands of pages. That's not a good place to start.

When you make an API call, it returns a cursor with a random code. If there are more pages available, the response will include a field called `next_cursor` which points to the next page.
Expand Down
109 changes: 109 additions & 0 deletions fern/docs/pages/references/snapkit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,115 @@ Inherited from [Snap](#snap):
}
```

### Table

A table element used to present JSON structured data.

#### Properties

- `rows` (required): The values to be displayed in the table. The data should be provided as a JSON object, where each cell is a plaintext SnapKit component.
- `columns` (required): Columns are defined as an array of objects, where each object has two parameters: an optional header and a required field key, which defines which field from rows is shown in the defined column. If a key is not used, it means that the associated data from rows will not be displayed in the table. The order of keys also defines the order in which values from rows are shown in the table.

#### Inherited properties

Inherited from [Snap](#snap):

- `type` (required): The type of the element, should be set to `"table"`.
- `block_id` (optional): A unique identifier for the snap. If not provided, a random ID is generated.

#### Example

![table](https://github.com/starlightknown/blender-portfolio/assets/74637789/65274552-6317-4af9-b04b-c03a651eb412)

```json
{
"elements": [
{
"columns": [
{
"header": {
"text": "Date",
"type": "plain_text"
},
"key": "date"
},
{
"header": {
"text": "Status",
"type": "plain_text"
},
"key": "status"
},
{
"header": {
"text": "Project Title",
"type": "plain_text"
},
"key": "title"
}
],
"rows": [
{
"date": {
"text": "2024-03-04",
"type": "plain_text"
},
"hiddenField": {
"text": "Hidden value",
"type": "plain_text"
},
"status": {
"text": "Completed",
"type": "plain_text"
},
"title": {
"text": "Project A",
"type": "plain_text"
}
},
{
"date": {
"text": "2024-03-05",
"type": "plain_text"
},
"hiddenField": {
"text": "hidden",
"type": "plain_text"
},
"status": {
"text": "In Progress",
"type": "plain_text"
},
"title": {
"text": "Project B",
"type": "plain_text"
}
},
{
"date": {
"text": "2024-03-06",
"type": "plain_text"
},
"hiddenField": {
"text": "hidden",
"type": "plain_text"
},
"status": {
"text": "Pending",
"type": "plain_text"
},
"title": {
"text": "Project C",
"type": "plain_text"
}
}
],
"type": "table"
}
]
}
```

## Form elements

<AccordionGroup>
Expand Down
Loading