Skip to content

Commit c4105ac

Browse files
Pagination (#47)
* fix pagination * Update fern/docs/pages/pagination.mdx Co-authored-by: Ben Colborn <[email protected]> --------- Co-authored-by: Ben Colborn <[email protected]>
1 parent 08b67cc commit c4105ac

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

fern/docs/pages/pagination.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
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.
2+
DevRev API uses a cursor-based pagination to provide consistency and support large data.
23
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.
34

45
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.

fern/docs/pages/references/snapkit.mdx

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,115 @@ Inherited from [Snap](#snap):
670670
}
671671
```
672672

673+
### Table
674+
675+
A table element used to present JSON structured data.
676+
677+
#### Properties
678+
679+
- `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.
680+
- `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.
681+
682+
#### Inherited properties
683+
684+
Inherited from [Snap](#snap):
685+
686+
- `type` (required): The type of the element, should be set to `"table"`.
687+
- `block_id` (optional): A unique identifier for the snap. If not provided, a random ID is generated.
688+
689+
#### Example
690+
691+
![table](https://github.com/starlightknown/blender-portfolio/assets/74637789/65274552-6317-4af9-b04b-c03a651eb412)
692+
693+
```json
694+
{
695+
"elements": [
696+
{
697+
"columns": [
698+
{
699+
"header": {
700+
"text": "Date",
701+
"type": "plain_text"
702+
},
703+
"key": "date"
704+
},
705+
{
706+
"header": {
707+
"text": "Status",
708+
"type": "plain_text"
709+
},
710+
"key": "status"
711+
},
712+
{
713+
"header": {
714+
"text": "Project Title",
715+
"type": "plain_text"
716+
},
717+
"key": "title"
718+
}
719+
],
720+
"rows": [
721+
{
722+
"date": {
723+
"text": "2024-03-04",
724+
"type": "plain_text"
725+
},
726+
"hiddenField": {
727+
"text": "Hidden value",
728+
"type": "plain_text"
729+
},
730+
"status": {
731+
"text": "Completed",
732+
"type": "plain_text"
733+
},
734+
"title": {
735+
"text": "Project A",
736+
"type": "plain_text"
737+
}
738+
},
739+
{
740+
"date": {
741+
"text": "2024-03-05",
742+
"type": "plain_text"
743+
},
744+
"hiddenField": {
745+
"text": "hidden",
746+
"type": "plain_text"
747+
},
748+
"status": {
749+
"text": "In Progress",
750+
"type": "plain_text"
751+
},
752+
"title": {
753+
"text": "Project B",
754+
"type": "plain_text"
755+
}
756+
},
757+
{
758+
"date": {
759+
"text": "2024-03-06",
760+
"type": "plain_text"
761+
},
762+
"hiddenField": {
763+
"text": "hidden",
764+
"type": "plain_text"
765+
},
766+
"status": {
767+
"text": "Pending",
768+
"type": "plain_text"
769+
},
770+
"title": {
771+
"text": "Project C",
772+
"type": "plain_text"
773+
}
774+
}
775+
],
776+
"type": "table"
777+
}
778+
]
779+
}
780+
```
781+
673782
## Form elements
674783

675784
<AccordionGroup>

0 commit comments

Comments
 (0)