Skip to content

Commit

Permalink
Fix blank DEV UI extension pages when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed May 16, 2023
1 parent e2c3b4e commit 89d5578
Show file tree
Hide file tree
Showing 16 changed files with 109 additions and 104 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { LitElement, html, css} from 'lit';
import { until } from 'lit/directives/until.js';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/grid';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
Expand Down Expand Up @@ -54,12 +53,15 @@ export class QwcArcFiredEvents extends LitElement {
}

render() {
return html`${until(this._renderFiredEvents(), html`<span>Loading ArC fired event...</span>`)}`;
if(this._firedEvents){
return this._renderFiredEvents();
} else {
return html`<span>Loading ArC fired event...</span>`;
}
}

_renderFiredEvents(){
if(this._firedEvents){
return html`<div class="menubar">
return html`<div class="menubar">
<vaadin-button theme="small" @click=${() => this._refresh()} class="button">
<vaadin-icon icon="font-awesome-solid:rotate"></vaadin-icon> Refresh
</vaadin-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { LitElement, html, css} from 'lit';
import { until } from 'lit/directives/until.js';
import { JsonRpc } from 'jsonrpc';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import '@vaadin/grid';
Expand Down Expand Up @@ -50,12 +49,15 @@ export class QwcArcInvocationTrees extends LitElement {
}

render() {
return html`${until(this._renderInvocations(), html`<span>Loading ArC invocation trees...</span>`)}`;
if(this._invocations){
return this._renderInvocations();
} else {
return html`<span>Loading ArC invocation trees...</span>`;
}
}

_renderInvocations(){
if(this._invocations){
return html`<div class="menubar">
return html`<div class="menubar">
<vaadin-button theme="small" @click=${() => this._refresh()} class="button">
<vaadin-icon icon="font-awesome-solid:rotate"></vaadin-icon> Refresh
</vaadin-button>
Expand All @@ -76,7 +78,6 @@ export class QwcArcInvocationTrees extends LitElement {
resizable>
</vaadin-grid-column>
</vaadin-grid>`;
}
}

_invocationsRenderer(invocation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import '@vaadin/text-area';
import '@vaadin/form-layout';
import '@vaadin/progress-bar';
import '@vaadin/checkbox';
import { until } from 'lit/directives/until.js';
import '@vaadin/grid';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import '@vaadin/grid/vaadin-grid-sort-column.js';
Expand Down Expand Up @@ -52,15 +51,18 @@ export class QwcCacheCaches extends LitElement {
* @returns {*}
*/
render() {
return html`${until(this._renderCacheTable(), html`<span>Loading caches...</span>`)}`;
if (this._caches) {
return this._renderCacheTable();
} else {
return html`<span>Loading caches...</span>`;
}
}

// View / Templates

_renderCacheTable() {
if (this._caches) {
let caches = [...this._caches.values()];
return html`
let caches = [...this._caches.values()];
return html`
<vaadin-grid .items="${caches}" class="datatable" theme="no-border">
<vaadin-grid-column auto-width
header="Name"
Expand All @@ -78,7 +80,6 @@ export class QwcCacheCaches extends LitElement {
resizable>
</vaadin-grid-column>
</vaadin-grid>`;
}
}

_actionRenderer(cache) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {LitElement, html, css, render} from 'lit';
import {JsonRpc} from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/button';
import {until} from 'lit/directives/until.js';
import '@vaadin/grid';
import '@vaadin/grid/vaadin-grid-sort-column.js';
import {builderTypes} from 'build-time-data';
Expand Down Expand Up @@ -62,10 +61,6 @@ export class QwcContainerImageBuild extends LitElement {
* @returns {*}
*/
render() {
return html`${until(this._renderForm(), html`<span>Loading...</span>`)}`;
}

_renderForm() {
const _builders = [];
let _defaultBuilder = "";
if(this.builders){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import '@vaadin/text-area';
import '@vaadin/form-layout';
import '@vaadin/progress-bar';
import '@vaadin/checkbox';
import { until } from 'lit/directives/until.js';
import '@vaadin/grid';
import 'qui-alert';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
Expand Down Expand Up @@ -49,12 +48,15 @@ export class QwcDatasourcesReset extends LitElement {
}

render() {
return html`${until(this._renderDataSourceTable(), html`<span>Loading datasources...</span>`)}`;
if (this._ds) {
return this._renderDataSourceTable();
} else {
return html`<span>Loading datasources...</span>`;
}
}

_renderDataSourceTable() {
if (this._ds) {
return html`
return html`
${this._message}
<vaadin-grid .items="${this._ds}" class="datatable" theme="no-border">
<vaadin-grid-column auto-width
Expand All @@ -67,7 +69,6 @@ export class QwcDatasourcesReset extends LitElement {
resizable>
</vaadin-grid-column>
</vaadin-grid>`;
}
}

_actionRenderer(ds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { LitElement, html, css} from 'lit';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/button';
import { until } from 'lit/directives/until.js';
import '@vaadin/grid';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';

Expand All @@ -28,14 +27,17 @@ export class HibernateOrmEntityTypesComponent extends LitElement {
}

render() {
return html`${until(this._renderAllPUs(), html`<span>Loading...</span>`)}`;
if (this._persistenceUnits) {
return this._renderAllPUs();
} else {
return html`<span>Loading...</span>`;
}
}

_renderAllPUs() {
if (this._persistenceUnits) {
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
<vaadin-tabsheet class="full-height">
<span slot="prefix">Persistence Unit</span>
<vaadin-tabs slot="tabs">
Expand All @@ -53,7 +55,6 @@ export class HibernateOrmEntityTypesComponent extends LitElement {
</div>
`)}
</vaadin-tabsheet>`;
}
}

_renderEntityTypesTable(pu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { LitElement, html, css} from 'lit';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/button';
import { until } from 'lit/directives/until.js';
import '@vaadin/grid';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';

Expand All @@ -28,14 +27,17 @@ export class HibernateOrmNamedQueriesComponent extends LitElement {
}

render() {
return html`${until(this._renderAllPUs(), html`<span>Loading...</span>`)}`;
if (this._persistenceUnits) {
return this._renderAllPUs();
} else {
return html`<span>Loading...</span>`;
}
}

_renderAllPUs() {
if (this._persistenceUnits) {
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
<vaadin-tabsheet class="full-height">
<span slot="prefix">Persistence Unit</span>
<vaadin-tabs slot="tabs">
Expand All @@ -53,7 +55,6 @@ export class HibernateOrmNamedQueriesComponent extends LitElement {
</div>
`)}
</vaadin-tabsheet>`;
}
}

_renderNamedQueriesTable(pu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { LitElement, html, css} from 'lit';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/button';
import { until } from 'lit/directives/until.js';
import '@vaadin/grid';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
import { notifier } from 'notifier';
Expand Down Expand Up @@ -38,14 +37,17 @@ export class HibernateOrmPersistenceUnitsComponent extends LitElement {
}

render() {
return html`${until(this._renderAllPUs(), html`<span>Loading...</span>`)}`;
if (this._persistenceUnits) {
return this._renderAllPUs();
} else {
return html`<span>Loading...</span>`;
}
}

_renderAllPUs() {
if (this._persistenceUnits) {
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
<vaadin-tabsheet class="full-height">
<span slot="prefix">Persistence Unit</span>
<vaadin-tabs slot="tabs">
Expand All @@ -62,7 +64,6 @@ export class HibernateOrmPersistenceUnitsComponent extends LitElement {
</div>
`)}
</vaadin-tabsheet>`;
}
}

_renderPersistenceUnit(pu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { LitElement, html, css} from 'lit';
import { JsonRpc } from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/button';
import { until } from 'lit/directives/until.js';
import '@vaadin/grid';
import '@vaadin/grid/vaadin-grid-selection-column.js';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';
Expand Down Expand Up @@ -35,14 +34,17 @@ export class HibernateSearchOrmElasticsearchIndexedEntitiesComponent extends Lit
}

render() {
return html`${until(this._renderAllPUs(), html`<span>Loading...</span>`)}`;
if (this._persistenceUnits) {
return this._renderAllPUs();
} else {
return html`<span>Loading...</span>`;
}
}

_renderAllPUs() {
if (this._persistenceUnits) {
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
return this._persistenceUnits.length == 0
? html`<p>No persistence units were found.</p>`
: html`
<vaadin-tabsheet class="full-height">
<span slot="prefix">Persistence Unit</span>
<vaadin-tabs slot="tabs">
Expand All @@ -60,7 +62,6 @@ export class HibernateSearchOrmElasticsearchIndexedEntitiesComponent extends Lit
</div>
`)}
</vaadin-tabsheet>`;
}
}

_renderEntityTypesTable(pu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {LitElement, html, css, render} from 'lit';
import {JsonRpc} from 'jsonrpc';
import '@vaadin/icon';
import '@vaadin/button';
import {until} from 'lit/directives/until.js';
import '@vaadin/grid';
import '@vaadin/grid/vaadin-grid-sort-column.js';
import {builderTypes} from 'build-time-data';
Expand Down Expand Up @@ -68,10 +67,6 @@ export class QwcOpenshiftDeployment extends LitElement {
* @returns {*}
*/
render() {
return html`${until(this._renderForm(), html`<span>Loading...</span>`)}`;
}

_renderForm() {
const _builders = [];
let _defaultBuilder = "";
if (this.builders) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import '@vaadin/checkbox';
import '@vaadin/grid';
import '@vaadin/grid/vaadin-grid-sort-column.js';
import 'qui-alert';
import { until } from 'lit/directives/until.js';
import { columnBodyRenderer } from '@vaadin/grid/lit.js';

export class QwcLiquibaseDatasources extends LitElement {
Expand Down Expand Up @@ -54,12 +53,15 @@ export class QwcLiquibaseDatasources extends LitElement {
}

render() {
return html`${until(this._renderDataSourceTable(), html`<span>Loading datasources...</span>`)}`;
if (this._factories) {
return this._renderDataSourceTable();
} else {
return html`<span>Loading datasources...</span>`;
}
}

_renderDataSourceTable() {
if (this._factories) {
return html`
return html`
${this._message}
<vaadin-grid .items="${this._factories}" class="datatable" theme="no-border">
<vaadin-grid-column auto-width
Expand All @@ -78,16 +80,15 @@ export class QwcLiquibaseDatasources extends LitElement {
confirm-text="Clear"
.opened="${this._dialogOpened}"
@confirm="${() => {
this._clear(this._ds);
}}"
this._clear(this._ds);
}}"
@cancel="${() => {
this._dialogOpened = false;
}}"
this._dialogOpened = false;
}}"
>
This will drop all objects (tables, views, procedures, triggers, ...) in the configured schema. Do you want to continue?
</vaadin-confirm-dialog>
`;
}
}

_actionRenderer(ds) {
Expand Down
Loading

0 comments on commit 89d5578

Please sign in to comment.