Skip to content

Commit 0ee0636

Browse files
authored
Merge pull request quarkusio#36231 from nderwin-forks/feature/update-dev-ui-2-docs
Update dev-ui-v2 documentation
2 parents 2eb7790 + 5eb142a commit 0ee0636

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

docs/src/main/asciidoc/dev-ui-v2.adoc

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ image::dev-ui-overview-v2.png[alt=Dev UI overview,role="center"]
2424

2525
It allows you to:
2626

27-
- quickly visualise all the extensions currently loaded
27+
- quickly visualize all the extensions currently loaded
2828
- view extension statuses and go directly to extension documentation
2929
- view and change `Configuration`
30-
- manage and visualise `Continuous Testing`
30+
- manage and visualize `Continuous Testing`
3131
- view `Dev Services` information
3232
- view the Build information
33-
- view and stream various logs.
33+
- view and stream various logs
3434
3535
Each extension used in the application will be listed and you can navigate to the guide for each extension, see some more information on the extension, and view configuration applicable for that extension:
3636

@@ -42,7 +42,7 @@ In order to make your extension listed in the Dev UI you don't need to do anythi
4242

4343
So you can always start with that :)
4444

45-
Extension can:
45+
Extensions can:
4646

4747
- <<add-links-to-an-extension-card,Add links to an extension card>>
4848
- <<add-full-pages,Add full custom pages>>
@@ -60,7 +60,7 @@ A good example of this is the SmallRye OpenAPI extension that contains links to
6060

6161
image::dev-ui-extension-openapi-v2.png[alt=Dev UI extension card,role="center"]
6262

63-
The links to these external references is know at build time, so to get links like this on your card, all you need to do is add the following Build Step in your extension:
63+
The links to these external references is known at build time, so to get links like this on your card, all you need to do is add the following Build Step in your extension:
6464

6565
[source,java]
6666
----
@@ -87,9 +87,9 @@ public CardPageBuildItem pages(NonApplicationRootPathBuildItem nonApplicationRoo
8787
return cardPageBuildItem;
8888
}
8989
----
90-
<1> Always make sure that this build step only run when dev mode
90+
<1> Always make sure that this build step is only run when in dev mode
9191
<2> To add anything on the card, you need to return/produce a `CardPageBuildItem`.
92-
<3> To add a link, you can use the `addPage` method, as all links go to a "page". `Page` has got some builders to assist with building a page. For `external` links, use the `externalPageBuilder`
92+
<3> To add a link, you can use the `addPage` method, as all links go to a "page". `Page` has some builders to assist with building a page. For `external` links, use the `externalPageBuilder`
9393
<4> Adding the url of the external link (in this case we use `NonApplicationRootPathBuildItem` to create this link, as this link is under the configurable non application path, default `/q`). Always use `NonApplicationRootPathBuildItem` if your link is available under `/q`.
9494
<5> You can (optionally) hint the content type of the content you are navigating to. If there is no hint, a header call will be made to determine the `MediaType`;
9595
<6> You can add an icon. All free font-awesome icons are available.
@@ -101,15 +101,15 @@ If you find your icon at https://fontawesome.com/search?o=r&m=free[Font awesome]
101101

102102
==== Embedding external content
103103

104-
By default, even external links will render inside (embedded) in Dev UI. In the case of HTML the page will be rendered and any other content will be shown using https://codemirror.net/[code-mirror] to markup the media type, for example the open api schema document in `yaml` format:
104+
By default, even external links will render inside (embedded) in Dev UI. In the case of HTML, the page will be rendered and any other content will be shown using https://codemirror.net/[code-mirror] to markup the media type. For example the open api schema document in `yaml` format:
105105

106106
image::dev-ui-extension-openapi-embed-v2.png[alt=Dev UI embedded page,role="center"]
107107

108-
If you do not want to embed the content, you can use the `.doNotEmbed()` on the Page Builder, this will then open a new tab.
108+
If you do not want to embed the content, you can use the `.doNotEmbed()` on the Page Builder, this will then open the link in a new tab.
109109

110110
==== Runtime external links
111111

112-
The example above assumes you know the link to use at build time. There might be cases where you only know this at runtime. In that case you can use a <<JsonRPC>> Method that returns the link to add and use that when creating the link. Rather than using the `.url` method on the page builder, use the `.dynamicUrlJsonRPCMethodName("yourJsonRPCMethodName")`.
112+
The example above assumes you know the link to use at build time. There might be cases where you only know this at runtime. In that case you can use a <<JsonRPC>> Method that returns the link to add, and use that when creating the link. Rather than using the `.url` method on the page builder, use the `.dynamicUrlJsonRPCMethodName("yourJsonRPCMethodName")`.
113113

114114
==== Adding labels
115115

@@ -189,7 +189,7 @@ image::dev-ui-table-page-v2.png[alt=Dev UI table page,role="center"]
189189

190190
==== Qute data
191191

192-
You can also display your build time data using a qute template. All build time data keys is available to use int the template:
192+
You can also display your build time data using a qute template. All build time data keys are available to use in the template:
193193

194194
[source,java]
195195
----
@@ -200,7 +200,7 @@ cardPageBuildItem.addPage(Page.quteDataPageBuilder("Qute data") // <1>
200200
<1> Use the `quteDataPageBuilder`.
201201
<2> Link to the Qute template in `/deployment/src/main/resources/dev-ui/`.
202202

203-
Using any qute template to display the data, example `qute-jokes-template.html`:
203+
Using any Qute template to display the data, for example `qute-jokes-template.html`:
204204

205205
[source,html]
206206
----
@@ -227,7 +227,7 @@ Using any qute template to display the data, example `qute-jokes-template.html`:
227227

228228
==== Web Component page
229229

230-
To build an interactive page with actions and runtime (or built time) data, you need to use the web component page:
230+
To build an interactive page with actions and runtime (or build time) data, you need to use the web component page:
231231

232232
[source,java]
233233
----
@@ -237,7 +237,7 @@ cardPageBuildItem.addPage(Page.webComponentPageBuilder() // <1>
237237
.staticLabel(String.valueOf(beans.size())));
238238
----
239239
<1> Use the `webComponentPageBuilder`.
240-
<2> Link to the Web Component in `/deployment/src/main/resources/dev-ui/`. The title can also be defined (using `.title("My title")` in the builder), but if not the title will be assumed from the componentLink, that should always have the format `qwc` (stands for Quarkus Web Component) dash `extensionName` (example, `arc` in this case ) dash `page title` ("Beans" in this case)
240+
<2> Link to the Web Component in `/deployment/src/main/resources/dev-ui/`. The title can also be defined (using `.title("My title")` in the builder), but if not the title will be assumed from the componentLink, which should always have the format `qwc` (stands for Quarkus Web Component) dash `extensionName` (example, `arc` in this case ) dash `page title` ("Beans" in this case)
241241

242242
Dev UI uses https://lit.dev/[Lit] to make building these web components easier. You can read more about Web Components and Lit:
243243

@@ -292,14 +292,14 @@ customElements.define('qwc-arc-beans', QwcArcBeans); // <10>
292292
----
293293

294294
<1> You can import Classes and/or functions from other libraries.
295-
In this case we use `LitElement` class and `html` & `css` functions from `Lit`
296-
<2> Build time data as defined in the Build step can be imported using the key and always from `build-time-data`. All keys added in your Build step will be available.
295+
In this case we use the `LitElement` class and `html` & `css` functions from `Lit`
296+
<2> Build time data as defined in the Build step and can be imported using the key and always from `build-time-data`. All keys added in your Build step will be available.
297297
<3> The component should be named in the following format: Qwc (stands for Quarkus Web Component) then Extension Name then Page Title, all concatenated with Camel Case. This will also match the file name format as described earlier. The component should also extend `LitComponent`.
298298
<4> CSS styles can be added using the `css` function, and these styles only apply to your component.
299299
<5> Styles can reference globally defined CSS variables to make sure your page renders correctly, especially when switching between light and dark mode. You can find all CSS variables in the Vaadin documentation (https://vaadin.com/docs/latest/styling/lumo/lumo-style-properties/color[Color], https://vaadin.com/docs/latest/styling/lumo/lumo-style-properties/size-space[Sizing and Spacing], etc)
300-
<6> Properties can be added. Use `_` in front of a property if that property is private. Properties are usually injected in the HTML template, and can be defined as having state, meaning that if that property changes, the component should re-render. In this case, the beans are Build time data and only change on hot-reload, that we will cover later.
300+
<6> Properties can be added. Use `_` in front of a property if that property is private. Properties are usually injected in the HTML template, and can be defined as having state, meaning that if that property changes, the component should re-render. In this case, the beans are Build time data and only change on hot-reload, which will be covered later.
301301
<7> Constructors (optional) should always call `super` first, and then set the default values for the properties.
302-
<8> The render method (comes from `LitElement` will be called to render the page). In this method you return the markup of the page you want. You can use the `html` function from `Lit`, that gives you a template language to output the HTML you want. Once the template is created, you only need to set/change the properties to re-render the page content. Read more about https://lit.dev/docs/components/rendering/[Lit html]
302+
<8> The render method (from `LitElement`) will be called to render the page. In this method you return the markup of the page you want. You can use the `html` function from `Lit`, that gives you a template language to output the HTML you want. Once the template is created, you only need to set/change the properties to re-render the page content. Read more about https://lit.dev/docs/components/rendering/[Lit html]
303303
<9> You can use the built-in template functions to do conditional, list, etc. Read more about https://lit.dev/docs/templates/overview/[Lit Templates]
304304
<10> You always need to register your Web component as a custom element, with a unique tag. Here the tag will follow the same format as the filename (`qwc` dash `extension name` dash `page title` );
305305

@@ -458,11 +458,11 @@ customElements.define('qwc-arc-beans', QwcArcBeans);
458458
----
459459
<1> Import the Vaadin component you want to use
460460
<2> You can also import other functions if needed
461-
<3> There are some internal UI component that you can use, described below
461+
<3> There are some internal UI components that you can use, described below
462462

463463
===== Using internal UI components
464464

465-
Some https://github.com/quarkusio/quarkus/tree/main/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qui[internal UI components] (under the `qui` namespace) is available to make certain things easier:
465+
Some https://github.com/quarkusio/quarkus/tree/main/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qui[internal UI components] (under the `qui` namespace) are available to make certain things easier:
466466

467467
- Card
468468
- Badge
@@ -501,7 +501,7 @@ image::dev-ui-qui-badge-v2.png[alt=Dev UI Badge,role="center"]
501501
import 'qui-badge';
502502
----
503503

504-
You can use any combination of small, primary, pill, with icon and clickable with any level of `default`, `success`, `warning`, `error`, `contrast` or set your own colours.
504+
You can use any combination of small, primary, pill, with icon and clickable with any level of `default`, `success`, `warning`, `error`, `contrast` or set your own colors.
505505

506506
[source,html]
507507
----
@@ -603,7 +603,7 @@ https://github.com/phillip-kruger/quarkus-jokes/blob/f572ed6f949de0c0b8cbfa99d73
603603

604604
====== Alert
605605

606-
Alerts is modelled around the Bootstrap alerts. Click https://getbootstrap.com/docs/4.0/components/alerts[here] for more info.
606+
Alerts are modeled around the Bootstrap alerts. Click https://getbootstrap.com/docs/4.0/components/alerts[here] for more info.
607607

608608
Also see Notification controller below as an alternative.
609609

@@ -733,7 +733,7 @@ https://github.com/quarkusio/quarkus/blob/582f1f78806d2268885faea7aa8f5a4d2b3f5b
733733

734734
===== Using internal controllers
735735

736-
Some https://github.com/quarkusio/quarkus/tree/main/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/controller[internal controllers] is available to make certain things easier:
736+
Some https://github.com/quarkusio/quarkus/tree/main/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/controller[internal controllers] are available to make certain things easier:
737737

738738
- Notifier
739739
- Storage
@@ -776,7 +776,7 @@ https://github.com/phillip-kruger/quarkus-jokes/blob/f572ed6f949de0c0b8cbfa99d73
776776

777777
An easy way to access the local storage in a safe way. This will store values in the local storage, scoped to your extension. This way you do not have to worry that you might clash with another extension.
778778

779-
Local storage is useful to remember user preferences or state. Example, the footer remembers the state (open/close) and the size when open of the bottom drawer.
779+
Local storage is useful to remember user preferences or state. For example, the footer remembers the state (open/close) and the size when open of the bottom drawer.
780780

781781
[source,javascript]
782782
----
@@ -836,7 +836,7 @@ https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/dev-ui-reso
836836

837837
====== Router
838838

839-
The router is mostly used internally. This uses https://github.com/vaadin/router[Vaadin Router] under the covers to route urls to the correct page/section within the SPA. It will update the navigation and allow history (back button). This also creates the sub-menu available on extensions that has multiple pages.
839+
The router is mostly used internally. This uses https://github.com/vaadin/router[Vaadin Router] under the covers to route URLs to the correct page/section within the SPA. It will update the navigation and allow history (back button). This also creates the sub-menu available on extensions that have multiple pages.
840840

841841
See the https://github.com/quarkusio/quarkus/blob/main/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/controller/router-controller.js[controller] for some methods that might be useful.
842842

@@ -860,7 +860,7 @@ JsonRPCProvidersBuildItem createJsonRPCServiceForCache() {// <2>
860860
----
861861
<1> Always only do this in Dev Mode
862862
<2> Produce / return a `JsonRPCProvidersBuildItem`
863-
<3> Define the class in your runtime module that will contain methods that makes data available in the UI
863+
<3> Define the class in your runtime module that will contain methods that make data available in the UI
864864

865865
https://github.com/quarkusio/quarkus/blob/main/extensions/cache/deployment/src/main/java/io/quarkus/cache/deployment/devui/CacheDevUiProcessor.java[Example code]
866866

@@ -930,13 +930,13 @@ connectedCallback() {
930930
----
931931

932932
<1> Note the method `getAll` corresponds to the method in your Java Service. This method returns a https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise[Promise] with the JsonRPC result.
933-
<2> in this case the result is an array, so we can loop over it.
933+
<2> In this case the result is an array, so we can loop over it.
934934

935935
JsonArray (or any Java collection) in either blocking or non-blocking will return an array, else a JsonObject will be returned.
936936

937937
https://github.com/quarkusio/quarkus/blob/main/extensions/cache/deployment/src/main/resources/dev-ui/qwc-cache-caches.js[Example code]
938938

939-
You can also pass in parameters in the method being called, example:
939+
You can also pass in parameters in the method being called, for example:
940940
(In the Runtime Java code)
941941

942942
[source,java]
@@ -1047,7 +1047,7 @@ export class QwcMyExtensionPage extends QwcHotReloadElement {
10471047

10481048
== Custom cards
10491049

1050-
You can customise the card that is being displayed on the extension page if you do not want to use the default built-in card.
1050+
You can customize the card that is being displayed on the extension page if you do not want to use the default built-in card.
10511051

10521052
To do this, you need to provide a Webcomponent that will be loaded in the place of the provided card and register this in the Java Processor:
10531053

@@ -1063,7 +1063,7 @@ On the Javascript side, you have access to all the pages (in case you want to cr
10631063
import { pages } from 'build-time-data';
10641064
----
10651065

1066-
And the following properties will be passes in:
1066+
And the following properties will be passed in:
10671067

10681068
- extensionName
10691069
- description

0 commit comments

Comments
 (0)