Rate this page:
The DashboardGadgetEdit
component is returned from a function
defined in the edit
property
in the app manifest. When the component is returned, an edit mode is rendered for the dashboard gadget.
This component can be used in Jira Core, Jira Software, and Jira Service Desk to render an edit mode for a dashboard gadget in the Dashboards page.
In edit mode, dashboard gadgets use a mechanism built into Jira to update the stored gadget configuration.
1 2import ForgeUI, { DashboardGadgetEdit } from "@forge/ui";
Name | Type | Required | Description |
---|---|---|---|
children | Array | Yes | The edit code for the dashboard gadget. Can contain any UI Kit component. |
onSubmit | (formData: FormData) => Promise | Yes | An event handler that can be asynchronous. The argument, formData , is an object made up of input field keys and their
values (see the following example).
|
The onSubmit
function must be provided for the gadget configuration to be saved. The values returned from onSubmit
are the values that are saved as the gadget configuration.
A simple example of a dashboard gadget edit component enabling the input of a name that is displayed in the app's view mode.
1 2import ForgeUI, { render, DashboardGadgetEdit, TextField, } from "@forge/ui"; const Edit = () => { const onSubmit = (values) => { return values; } return ( <DashboardGadgetEdit onSubmit={onSubmit}> <TextField name="name" label="Say hello to:" /> </DashboardGadgetEdit> ); }; export const runEdit = render(<Edit />);
This is the dashboard gadget edit mode created by the example code.
Rate this page: