Skip to content

chore: add Snap Components page #111

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 6 commits into from
Nov 13, 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
17 changes: 5 additions & 12 deletions fern/docs/pages/references/snap-components.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# Snap Components

Snap components enable adding custom UI components defined by snap-kit to the DevRev UI.
These components can be used to display data or interact with the user.
Snap components are defined in the snap-in manifest file. DevRev UI renders these components based on the defined configuration.

Each snap-component has the following properties:

- `surface` : the surfaces where the snap component can be displayed. Currently, only `issue` is supported. // TODO: Confirm this.
- `snap_kit_action_name` : the name of the snap kit action that will be triggered when the action defined in the snap-kit of the snap component is interacted with.
<!-- - `snap_kit_body` : the initial body of the snap kit action that will be rendered when the snap component is loaded. -->

<!-- - `initializer` : references a function that can be called to initialize the snap component. This is useful when the snap component needs to be initialized with data from the server based on the context where it is being initialized. -->
- `surface` : The surface where the snap component can be displayed.
- `snap_kit_action_name` : The name of the action within the snap kit that is triggered when the snap component's defined action is engaged.
- `snap_kit_body` : The initial body content of the snap kit action that is rendered upon loading the snap component.
- `initializer` : Refers to a function that can be invoked to set up the snap component. This is particularly useful when the component needs to be initialized with server data, depending on the context in which it is being deployed.

```yaml
functions:
Expand All @@ -27,7 +24,7 @@ snap_components:
description: Test Case Details
surface: issue
snap_kit_action_name: show_test_cases
<!-- initializer: upgrade_test_function_1 -->
initializer: upgrade_test_function_1
snap_kit_body:
{
"snaps":[]
Expand Down Expand Up @@ -104,10 +101,6 @@ interface Event {
}
```

## Screenshots

<!-- ## Example for initializer -->

## List of surfaces

| Surface | Description |
Expand Down
2 changes: 2 additions & 0 deletions fern/versions/public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ navigation:
path: ../docs/pages/references/hooks.mdx
- page: Snapkit
path: ../docs/pages/references/snapkit.mdx
- page: Snap Components
path: ../docs/pages/references/snap-components.mdx
- page: Snap-in resources
slug: snap-in-resources
path: ../docs/pages/references/snap-in-resources.mdx
Expand Down
Loading