Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / plugins / README.md
1 [comment]: # (Copyright © The Arvados Authors. All rights reserved.)
2 [comment]: # ()
3 [comment]: # (SPDX-License-Identifier: CC-BY-SA-3.0)
4
5 # Plugin support
6
7 Workbench supports plugins to add new functionality to the user
8 interface.  It is also possible to remove the majority of standard UI
9 elements and replace them with your own, enabling you to use workbench
10 as a basis for developing essentially new applications for Arvados.
11
12 ## Installing plugins
13
14 1. Check out the source of your plugin into a directory under `arvados-workbench2/src/plugins`
15
16 2. Register the plugin by editing `arvados-workbench2/src/plugins/plugins.tsx`.
17 It will look something like this:
18
19 ```
20 import { register as examplePluginRegister } from 'plugins/example/index';
21 examplePluginRegister(pluginConfig);
22 ```
23
24 3. Rebuild Workbench 2
25
26 For testing/development: `yarn start`
27
28 For production: `APP_NAME=arvados-workbench2-with-custom-plugins make packages`
29
30 Set `APP_NAME=` to whatever you like, but it is important to name it
31 differently from the standard `arvados-workbench2` to avoid confusion.
32
33 ## Existing plugins
34
35 ### example
36
37 This is an example plugin showing how to add a new navigation tree
38 item, displaying a new center panel, as well as adding account menu
39 and "New" menu items, and showing how to use SET_PROPERTY and
40 getProperty() for state.
41
42 ### blank
43
44 This deletes all of the existing user interface.  If you want the
45 application to only display your plugin's UI elements and none of the
46 standard elements, you would load and register this first.
47
48 ### root-redirect
49
50 This helper takes a path when registered.  It tweaks the navigation
51 behavior so that the default starting location when the application
52 loads will be the path you provide, instead of "Projects".
53
54 ### sample-tracker
55
56 This is a a new set of user interface screens that assist with
57 clinical sample tracking and analysis.  It is intended as a demo of
58 how a real-world application can built using the Workbench 2
59 plug-in interface.  It can be found at
60 https://github.com/arvados/sample-tracker .
61
62 ## Developing plugins
63
64 For information about the plugin API, see
65 [../common/plugintypes.ts](src/common/plugintypes.ts).