Skip to content

Commit

Permalink
Fix #11: Dev UI Card (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Aug 9, 2024
1 parent e632209 commit c1a4080
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void produceActivityBeans(
@BuildStep(onlyIf = EnableMock.class)
@Produce(ConfigValidatedBuildItem.class)
void recordWorkflowClient(Capabilities capabilities) {
if (capabilities.isMissing("fr.lavachequicode.temporal.test")) {
if (capabilities.isMissing("io.quarkiverse.temporal.test")) {
throw new ConfigurationException("Please add the quarkus-temporal-test extension to enable mocking");
}
}
Expand Down Expand Up @@ -221,4 +221,4 @@ public boolean getAsBoolean() {
}
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io.quarkiverse.temporal.deployment.devui;

import java.util.Objects;

import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.devui.spi.page.CardPageBuildItem;
import io.quarkus.devui.spi.page.ExternalPageBuilder;
import io.quarkus.devui.spi.page.Page;
import io.quarkus.devui.spi.page.PageBuilder;
import io.temporal.client.WorkflowClient;

/**
* Dev UI card for displaying important details such Temporal version.
*/
public class TemporalDevUIProcessor {

@BuildStep(onlyIf = IsDevelopment.class)
void createCard(BuildProducer<CardPageBuildItem> cardPageBuildItemBuildProducer) {
final CardPageBuildItem card = new CardPageBuildItem();

final PageBuilder<ExternalPageBuilder> versionPage = Page.externalPageBuilder("Version")
.icon("font-awesome-solid:book")
.url("https://temporal.io")
.doNotEmbed()
.staticLabel(Objects.toString(WorkflowClient.class.getPackage().getImplementationVersion(), "?"));
card.addPage(versionPage);

card.setCustomCard("qwc-temporal-card.js");

cardPageBuildItemBuildProducer.produce(card);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { LitElement, html, css} from 'lit';
import { pages } from 'build-time-data';
import 'qwc/qwc-extension-link.js';

const NAME = "Temporal";
export class QwcTemporalCard extends LitElement {

static styles = css`
.identity {
display: flex;
justify-content: flex-start;
}
.description {
padding-bottom: 10px;
}
.logo {
padding-bottom: 10px;
margin-right: 5px;
}
.card-content {
color: var(--lumo-contrast-90pct);
display: flex;
flex-direction: column;
justify-content: flex-start;
padding: 2px 2px;
height: 100%;
}
.card-content slot {
display: flex;
flex-flow: column wrap;
padding-top: 5px;
}
`;

static properties = {
description: {type: String}
};

constructor() {
super();
}

connectedCallback() {
super.connectedCallback();
}

render() {
return html`<div class="card-content" slot="content">
<div class="identity">
<div class="logo">
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOTIiIGhlaWdodD0iMTkyIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTkyIDE5MiI+PHJlY3Qgd2lkdGg9IjE5MiIgaGVpZ2h0PSIxOTIiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xNDUyXzUzMTcpIiByeD0iMjQiLz48cGF0aCBmaWxsPSIjRjJGMkYyIiBkPSJNMTIzLjM0IDY4LjY1OTZDMTE5LjY1NSA0MS4wNDg0IDExMC4zMjcgMTggOTYgMThDODEuNjczMSAxOCA3Mi4zNDU0IDQxLjA0ODQgNjguNjU5NiA2OC42NTk2QzQxLjA0ODQgNzIuMzQ1NCAxOCA4MS42NzMxIDE4IDk2QzE4IDExMC4zMjcgNDEuMDUyNSAxMTkuNjU1IDY4LjY1OTYgMTIzLjM0QzcyLjM0NTQgMTUwLjk0OCA4MS42NzMxIDE3NCA5NiAxNzRDMTEwLjMyNyAxNzQgMTE5LjY1NSAxNTAuOTQ4IDEyMy4zNCAxMjMuMzRDMTUwLjk1MiAxMTkuNjU1IDE3NCAxMTAuMzI3IDE3NCA5NkMxNzQgODEuNjczMSAxNTAuOTQ4IDcyLjM0NTQgMTIzLjM0IDY4LjY1OTZaTTY3Ljc1OD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ljc2MjIgMTA5Ljk4MyA3NS4xMzQgMTE2LjI1MiA3NS43NDgzQzExNy42MDYgNzUuODgxNyAxMjIuOTQgNzYuNTEyMSAxMjQuMjQyIDc2LjY5OEMxNTAuNjg1IDgwLjUxNzIgMTY2LjExMSA4OS4yNjI5IDE2Ni4xMTEgOTUuOTk2QzE2Ni4xMTEgMTAyLjcyOSAxNTAuNjg1IDExMS40NzkgMTI0LjI0MiAxMTUuMjk4WiIvPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl8xNDUyXzUzMTciIHgxPSIxODMiIHgyPSIwIiB5MT0iMTkyIiB5Mj0iMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM0NDRDRTciLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNCNjY0RkYiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4="
alt="${NAME}"
title="${NAME}"
width="32"
height="32">
</div>
<div class="description">${this.description}</div>
</div>
${this._renderCardLinks()}
</div>
`;
}

_renderCardLinks(){
return html`${pages.map(page => html`
<qwc-extension-link slot="link"
extensionName="${NAME}"
iconName="${page.icon}"
displayName="${page.title}"
staticLabel="${page.staticLabel}"
dynamicLabel="${page.dynamicLabel}"
streamingLabel="${page.streamingLabel}"
path="${page.id}"
?embed=${page.embed}
externalUrl="${page.metadata.externalUrl}"
webcomponent="${page.componentLink}" >
</qwc-extension-link>
`)}`;
}

}
customElements.define('qwc-temporal-card', QwcTemporalCard);
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ metadata:
- "integration"
config:
- "quarkus.temporal."
status: "preview"
status: "experimental"
guide: "https://quarkiverse.github.io/quarkiverse-docs/quarkus-temporal/dev/index.html"
icon-url: "https://raw.githubusercontent.com/quarkiverse/quarkus-temporal/main/docs/modules/ROOT/assets/images/temporal_logo.svg"
2 changes: 2 additions & 0 deletions integration-test/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# HTTP
quarkus.http.port=8081
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FeatureBuildItem feature() {

@BuildStep
void capabilities(BuildProducer<CapabilityBuildItem> capabilityProducer) {
capabilityProducer.produce(new CapabilityBuildItem("fr.lavachequicode.temporal.test", "temporal"));
capabilityProducer.produce(new CapabilityBuildItem("io.quarkiverse.temporal.test", "temporal"));
}

@Record(ExecutionTime.RUNTIME_INIT)
Expand Down

0 comments on commit c1a4080

Please sign in to comment.