You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* TODO: Generate HTML content to be inserted into the editor */
259
+
);
260
+
onClose();
261
+
}}
262
+
>
263
+
Insert
264
+
</Button>
265
+
</DialogActions>
266
+
</Dialog>
267
+
);
268
+
```
269
+
This gives us a few things
270
+
1. A header, utilising the branding colours as previously defined
271
+
2. A link to the help docs (once created the link will need to be added to [/src/main/webapp/ui/assets/DocLinks.js](/src/main/webapp/ui/assets/DocLinks.js)).
272
+
3. A title, briefly describing the purpose of the dialog. This may seem
273
+
superlfuous but in principle a single plugin, or any other integrations,
274
+
could provide multiple actions with multiple dialogs.
275
+
4. The DialogContent is where the behaviour of the plugins vary; it is here
276
+
that some display a list of options, while others may require user input.
277
+
If you would prefer, this could be the point where RSpace code calls out to
278
+
a separate NPM package, displaying a UI with visual similarity to your main
279
+
product, utilising a shared design system, component library, and be
280
+
written in any compiled-to-JS language. The dialog content could even be an
281
+
iframe if that would be easiest, although of course that comes with
282
+
security implications that would need to be carefully considered.
283
+
5. A cancel button for closing the dialog. No edits are made to the content of
284
+
the editor and it is as if the user never opened the dialog.
285
+
6. An insertion button that actually inserts some HTML content into the editor
286
+
and closes the dialog.
287
+
288
+
The imports required for the dialog are as follows:
289
+
```
290
+
import Dialog from "@mui/material/Dialog";
291
+
import DialogTitle from "@mui/material/DialogTitle";
292
+
import DialogContent from "@mui/material/DialogContent";
293
+
import DialogActions from "@mui/material/DialogActions";
294
+
import Button from "@mui/material/Button";
295
+
import AppBar from "../../components/AppBar";
296
+
import docLinks from "../../assets/DocLinks";
297
+
```
298
+
225
299
## Step 3: Testing
226
300
- How will we know if the plugin stops working e.g. due to API changes/services being down?
0 commit comments