From 11350e283d0ec989e9ffeb203f8bacc2ad6e9ea7 Mon Sep 17 00:00:00 2001 From: Rene Pot Date: Sun, 27 Oct 2024 21:34:44 -0700 Subject: [PATCH] docs:improve docs --- docs/developer/configure-a-capture-plugin.mdx | 5 +-- docs/developer/develop-a-capture-plugin.md | 6 +-- .../enrollment-plugins/manual-setup.mdx | 40 +++++++------------ .../form-field-plugins/developer-details.md | 6 +-- docs/developer/getting-started.md | 4 ++ 5 files changed, 26 insertions(+), 35 deletions(-) diff --git a/docs/developer/configure-a-capture-plugin.mdx b/docs/developer/configure-a-capture-plugin.mdx index dbf597972a..7f7ab36e39 100644 --- a/docs/developer/configure-a-capture-plugin.mdx +++ b/docs/developer/configure-a-capture-plugin.mdx @@ -1,5 +1,4 @@ import Logo from './resources/tracker-plugin-configurator-logo.png' -import TPCFormFieldDemoImg from './resources/tpc-form-field-demo.png' # Configuration @@ -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. -Tracker Plugin Configurator +Tracker Plugin Configurator ### How to use the Tracker Plugin Configurator @@ -25,5 +24,5 @@ The app is also installable from the App Management app in your DHIS2 instance.
-Form Field Plugin +![Form field plugin](resources/tpc-form-field-demo.png) diff --git a/docs/developer/develop-a-capture-plugin.md b/docs/developer/develop-a-capture-plugin.md index 1205c186b5..6f109ce37f 100644 --- a/docs/developer/develop-a-capture-plugin.md +++ b/docs/developer/develop-a-capture-plugin.md @@ -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 @@ -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. diff --git a/docs/developer/enrollment-plugins/manual-setup.mdx b/docs/developer/enrollment-plugins/manual-setup.mdx index bae6afbe0f..36c4443d5a 100644 --- a/docs/developer/enrollment-plugins/manual-setup.mdx +++ b/docs/developer/enrollment-plugins/manual-setup.mdx @@ -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` | @@ -37,10 +37,8 @@ You can also have different layouts for the three different enrollment pages. label={'Enrollment Dashboard'} default > - - {`{ +```json +{ "IpHINAT79UW": { "title": "Child Programme dashboard", "leftColumn": [ @@ -94,17 +92,15 @@ You can also have different layouts for the three different enrollment pages. } ] } -}`} - +} +``` - - {`{ +```json +{ "IpHINAT79UW": { "title": "Child Programme: Add Event", "leftColumn": [ @@ -150,17 +146,15 @@ You can also have different layouts for the three different enrollment pages. } ] } -}`} - +} +``` - - {`{ +```json +{ "IpHINAT79UW": { "title": "Child Programme: Edit Event", "leftColumn": [ @@ -215,7 +209,7 @@ You can also have different layouts for the three different enrollment pages. ] } }`} - +``` @@ -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. - -{`"leftColumn": [ +```json title="capture/enrollmentEventEditLayout" +"leftColumn": [ { "type": "component", "name": "EditEventWorkspace" @@ -284,6 +275,5 @@ You would place this inside either the `leftColumn` or `rightColumn` array. } // highlight-end ], -`} - +``` diff --git a/docs/developer/form-field-plugins/developer-details.md b/docs/developer/form-field-plugins/developer-details.md index 86b30531d9..cce32947ce 100644 --- a/docs/developer/form-field-plugins/developer-details.md +++ b/docs/developer/form-field-plugins/developer-details.md @@ -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. diff --git a/docs/developer/getting-started.md b/docs/developer/getting-started.md index 6fcd7ead9f..e25b294434 100644 --- a/docs/developer/getting-started.md +++ b/docs/developer/getting-started.md @@ -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,