From ffbc77bc468d421b697f645b7b892a7822e26294 Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Mon, 22 May 2023 11:50:36 +1000 Subject: [PATCH] Move Status tag to footer Signed-off-by: Phillip Kruger (cherry picked from commit 27f8c3676f8c9422e0dbb52b7255ddd689237362) --- .../resources/dev-ui/qwc/qwc-extension.js | 41 +++++++++++++++---- .../resources/dev-ui/qwc/qwc-extensions.js | 10 ----- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extension.js b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extension.js index 931ad190ec6be..d6162d2d9b7c9 100644 --- a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extension.js +++ b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extension.js @@ -2,6 +2,7 @@ import { LitElement, html, css} from 'lit'; import '@vaadin/icon'; import '@vaadin/dialog'; import { dialogHeaderRenderer, dialogRenderer } from '@vaadin/dialog/lit.js'; +import 'qui-badge'; /** * This component represent one extension @@ -41,7 +42,6 @@ export class QwcExtension extends LitElement { display: flex; flex-direction: row; justify-content: space-between; - visibility:hidden; } .card-footer a { @@ -60,15 +60,15 @@ export class QwcExtension extends LitElement { color: var(--lumo-contrast-70pct); } - .active:hover .card-footer, .active:hover .guide { + .active:hover .config, .active:hover .more, .active:hover .guide { visibility:visible; } - .inactive:hover .card-footer, .inactive:hover .guide { + .inactive:hover .config, .inactive:hover .more, .inactive:hover .guide { visibility:visible; } - .guide{ + .guide, .more, .config { visibility:hidden; } @@ -141,14 +141,39 @@ export class QwcExtension extends LitElement { _footerTemplate() { return html` `; } + _renderStatus(){ + var l = this._statusLevelOnCard(); + + if(l) { + return html`${this.status.toUpperCase()}`; + } + } + + _statusLevelOnCard(){ + if(this.status === "experimental") { + return "warning"; + } else if(this.status === "preview") { + return "contrast"; + } + return null; + } + + _statusLevel(){ + if(this.status === "stable") { + return "success"; + } + return this._statusLevelOnCard(); + } + _renderDialog(){ return html` @@ -181,7 +206,7 @@ export class QwcExtension extends LitElement { - + diff --git a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extensions.js b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extensions.js index bbe779ac6069d..6b845302c3c86 100644 --- a/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extensions.js +++ b/extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-extensions.js @@ -5,7 +5,6 @@ import { devuiState } from 'devui-state'; import { observeState } from 'lit-element-state'; import 'qwc/qwc-extension.js'; import 'qwc/qwc-extension-link.js'; -import 'qui-badge'; /** @@ -115,7 +114,6 @@ export class QwcExtensions extends observeState(LitElement) { return html`
- ${this._renderExperimentalBadge(extension)} ${extension.description} ${this._renderCardLinks(extension)} @@ -161,18 +159,10 @@ export class QwcExtensions extends observeState(LitElement) { providesCapabilities="${extension.providesCapabilities}" extensionDependencies="${extension.extensionDependencies}">
- ${this._renderExperimentalBadge(extension)} ${extension.description}
`; } } - - _renderExperimentalBadge(extension){ - if(extension.status === "experimental") { - return html`EXPERIMENTAL`; - } - } - } customElements.define('qwc-extensions', QwcExtensions);
Status${this.status}${this.status.toUpperCase()}
Config Filter