-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33538 from phillip-kruger/dev-ui-common-no-servic…
…e-component Dev UI new common component for no-service/data
- Loading branch information
Showing
4 changed files
with
64 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-no-data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { LitElement, html, css } from 'lit'; | ||
|
||
/** | ||
* This component can we used to show if there is not data to show | ||
*/ | ||
export class QwcNoData extends LitElement { | ||
static styles = css` | ||
.nodata { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 10px; | ||
border: 1px solid var(--lumo-contrast-20pct); | ||
border-radius: 9px; | ||
padding: 30px; | ||
margin: 30px; | ||
} | ||
.nodata a { | ||
color: var(--lumo-contrast-90pct); | ||
} | ||
`; | ||
|
||
|
||
static properties = { | ||
message: {attribute: true}, | ||
link: {attribute: true}, | ||
linkText: {attribute: true}, | ||
}; | ||
|
||
constructor() { | ||
super(); | ||
this.message = "No data to display"; | ||
this.link = null; | ||
this.linkText = "See the documentation for more information"; | ||
} | ||
|
||
render() { | ||
return html`<p class="nodata"> | ||
<span>${this.message}</span> | ||
${this._renderLink()} | ||
</p> | ||
`; | ||
} | ||
|
||
_renderLink(){ | ||
if(this.link){ | ||
return html`<a href="${this.link}" target="_blank"> ${this.linkText}</a>`; | ||
} | ||
} | ||
} | ||
|
||
customElements.define('qwc-no-data', QwcNoData); |