Skip to content
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: improve docs #3865

Merged
merged 1 commit into from
Oct 28, 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
5 changes: 2 additions & 3 deletions docs/developer/configure-a-capture-plugin.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Logo from './resources/tracker-plugin-configurator-logo.png'
import TPCFormFieldDemoImg from './resources/tpc-form-field-demo.png'

# Configuration

Expand All @@ -11,7 +10,7 @@ This application is called __Tracker Plugin Configurator__ and is available in t

The app is also installable from the App Management app in your DHIS2 instance.

<img src={Logo} alt="Tracker Plugin Configurator" style={{ width: '10%' }} />
<img src={Logo} alt="Tracker Plugin Configurator" style={{ width: '65px' }} />

### How to use the Tracker Plugin Configurator

Expand All @@ -25,5 +24,5 @@ The app is also installable from the App Management app in your DHIS2 instance.

<br />

<img src={TPCFormFieldDemoImg} alt="Form Field Plugin" />
![Form field plugin](resources/tpc-form-field-demo.png)

6 changes: 3 additions & 3 deletions docs/developer/develop-a-capture-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to develop a plugin for the DHIS2 Capture app.
id: develop-a-capture-plugin
---

To develop your own capture plugin, you need to follow these steps:
Developing a capture plugin is almost the same as developing a regular DHIS2 custom app. However, there are some differences in how you structure your plugin and how you configure it to work with the DHIS2 Capture app. These are outlined in the few steps below.

## Step 1: Create a new DHIS2 custom app

Expand Down Expand Up @@ -52,6 +52,6 @@ To build your plugin, you can use the provided build script from `d2-app-scripts
Run `yarn build` or (`d2-app-scripts build`) to build a production version of your plugin.

After building your plugin, you can deploy it to your DHIS2 instance.
You can do this by uploading the ZIP file to the _App management_ app in your DHIS2 instance, or publishing it to the app hub.
You can do this by uploading the ZIP file to the _App management_ app in your DHIS2 instance, or publishing it to the App Hub.

See [Configuring a Capture plugin](/docs/capture-plugins/developer/configure-a-capture-plugin) for more information on how to configure your plugin in the DHIS2 Capture app.
See [Configuring a Capture plugin](configure-a-capture-plugin) for more information on how to configure your plugin in the DHIS2 Capture app.
40 changes: 15 additions & 25 deletions docs/developer/enrollment-plugins/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When booting the capture application, we will look in the dataStore for these ke
We assume that you will already have these three keys under the `capture` namespace in the datastore. If you do not have them, please create them before proceeding.

| Page | Key |
|-----------------------|-----------------------------|
| --------------------- | --------------------------- |
| Enrollment Dashboard | `enrollmentOverviewLayout` |
| Enrollment Add Event | `enrollmentEventNewLayout` |
| Enrollment Edit Event | `enrollmentEventEditLayout` |
Expand All @@ -37,10 +37,8 @@ You can also have different layouts for the three different enrollment pages.
label={'Enrollment Dashboard'}
default
>
<CodeBlock
language={'json'}
>
{`{
```json
{
"IpHINAT79UW": {
"title": "Child Programme dashboard",
"leftColumn": [
Expand Down Expand Up @@ -94,17 +92,15 @@ You can also have different layouts for the three different enrollment pages.
}
]
}
}`}
</CodeBlock>
}
```
</TabItem>
<TabItem
value={'ENROLLMENT_EVENT_NEW'}
label={'Add Event'}
>
<CodeBlock
language={'json'}
>
{`{
```json
{
"IpHINAT79UW": {
"title": "Child Programme: Add Event",
"leftColumn": [
Expand Down Expand Up @@ -150,17 +146,15 @@ You can also have different layouts for the three different enrollment pages.
}
]
}
}`}
</CodeBlock>
}
```
</TabItem>
<TabItem
value={'ENROLLMENT_EVENT_EDIT'}
label={'Edit Event'}
>
<CodeBlock
language={'json'}
>
{`{
```json
{
"IpHINAT79UW": {
"title": "Child Programme: Edit Event",
"leftColumn": [
Expand Down Expand Up @@ -215,7 +209,7 @@ You can also have different layouts for the three different enrollment pages.
]
}
}`}
</CodeBlock>
```
</TabItem>
</Tabs>

Expand Down Expand Up @@ -268,11 +262,8 @@ You can also extend the configurations to render your own custom plugins. You ca
You would place this inside either the `leftColumn` or `rightColumn` array.
<CodeBlock
language={'json'}
title={'capture/enrollmentEventEditLayout'}
>
{`"leftColumn": [
```json title="capture/enrollmentEventEditLayout"
"leftColumn": [
{
"type": "component",
"name": "EditEventWorkspace"
Expand All @@ -284,6 +275,5 @@ You would place this inside either the `leftColumn` or `rightColumn` array.
}
// highlight-end
],
`}
</CodeBlock>
```
6 changes: 2 additions & 4 deletions docs/developer/form-field-plugins/developer-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ sidebar_label: Developer details
id: developer-details
---

Here are some details for developers who want to develop a form field plugin for the DHIS2 Capture app.

A form field plugin runs in a sandboxed environment, meaning it can only read and write data that it's been configured to have access to.
If the plugin is given access to a field, we provide any relevant values, metadata, and rules engine output for that field.
We also provide some context about the application state, mainly if the plugin is in view or edit mode, or if the form has been attempted submitted.
If the plugin is given access to a field, all relevant values, metadata, and rules engine output for that field is provided.
Also the context about the application state is provided, mainly if the plugin is in view or edit mode, or if the form has been attempted to be submitted.

If a plugin tries to update a field that it has not been given access to, an appropriate error message will be displayed in the console.

Expand Down
4 changes: 4 additions & 0 deletions docs/developer/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The plugin framework is currently an experimental feature and is subject to chan
We are working on improving both the technology and the way you use it. We will provide more documentation and examples as we progress.
:::

:::info Supported versions
The plugin framework is supported in **DHIS2 version 40.5 and later**.
:::

## What are plugins?
Plugins are a way to extend the functionality of our core applications within the DHIS2 ecosystem.
These plugins will act and feel like native widgets / components, and allow you to write custom code that will be injected into the core applications,
Expand Down
Loading