Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI updates: minor updates and completely removed checkLoginIFrame option in keycloak init (very buggy in our version of keycloak)

Rich Turner2e9dd840f511
diff --git a/ui/component/core/src/index.ts b/ui/component/core/src/index.ts
index 78ece75d9..fbd327e05 100644
--- a/ui/component/core/src/index.ts
+++ b/ui/component/core/src/index.ts
@@ -56,7 +56,7 @@ export interface ManagerConfig {
credentials?: Credentials;
consoleAutoEnable?: boolean;
eventProviderType?: EventProviderType;
- pollingIntervalMillis?: number
+ pollingIntervalMillis?: number;
}
export type EventCallback = (event: OREvent) => any;
@@ -497,12 +497,12 @@ export class Manager {
let keycloakPromise: any = null;
try {
// Try to use a stored offline refresh token if defined
- let offlineToken = await this._getNativeOfflineRefreshToken();
+ const offlineToken = await this._getNativeOfflineRefreshToken();
const authenticated = await new Promise<boolean>(((resolve, reject) => {
keycloakPromise = resolve;
this._keycloak.init({
- checkLoginIframe: !this.isMobile(), // Doesn't work well with offline tokens
+ checkLoginIframe: false, // Doesn't work well with offline tokens or periodic token updates
onLoad: this._config.autoLogin ? "login-required" : "check-sso",
refreshToken: offlineToken
}).success((auth: boolean) => {
diff --git a/ui/component/or-header/src/index.ts b/ui/component/or-header/src/index.ts
index b89bed8cd..90e43d363 100644
--- a/ui/component/or-header/src/index.ts
+++ b/ui/component/or-header/src/index.ts
@@ -1,5 +1,5 @@
import {OrHeaderStyle} from "@openremote/or-header/src/or-header-style";
-import {LitElement, html, css, property} from 'lit-element';
+import {css, html, LitElement, property, customElement} from "lit-element";
const menuIcon = html`<svg height="24" viewBox="0 0 24 24" width="24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path></svg>`;
@@ -16,15 +16,16 @@ const close = html`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox
<path d="M14.1,11.3c-0.2-0.2-0.2-0.5,0-0.7l7.5-7.5c0.2-0.2,0.3-0.5,0.3-0.7s-0.1-0.5-0.3-0.7l-1.4-1.4C20,0.1,19.7,0,19.5,0 c-0.3,0-0.5,0.1-0.7,0.3l-7.5,7.5c-0.2,0.2-0.5,0.2-0.7,0L3.1,0.3C2.9,0.1,2.6,0,2.4,0S1.9,0.1,1.7,0.3L0.3,1.7C0.1,1.9,0,2.2,0,2.4 s0.1,0.5,0.3,0.7l7.5,7.5c0.2,0.2,0.2,0.5,0,0.7l-7.5,7.5C0.1,19,0,19.3,0,19.5s0.1,0.5,0.3,0.7l1.4,1.4c0.2,0.2,0.5,0.3,0.7,0.3 s0.5-0.1,0.7-0.3l7.5-7.5c0.2-0.2,0.5-0.2,0.7,0l7.5,7.5c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l1.4-1.4c0.2-0.2,0.3-0.5,0.3-0.7 s-0.1-0.5-0.3-0.7L14.1,11.3z"/>
</svg>`;
+@customElement("or-header")
class OrHeader extends LitElement {
@property({type: Boolean})
private _drawerOpened = false;
@property({type: String})
- private logo = '';
+ private logo = "";
- static styles = css `
+ static styles = css`
#app-header {
position: absolute;
top: 0;
@@ -146,16 +147,11 @@ class OrHeader extends LitElement {
`;
}
- private _close () {
+ private _close() {
this._drawerOpened = false;
}
private _menuButtonClicked() {
this._drawerOpened = !this._drawerOpened;
}
-
}
-
-window.customElements.define('or-header', OrHeader);
-
-
diff --git a/ui/component/or-smart-notify/package.json b/ui/component/or-smart-notify/package.json
index 0589a81b5..fb72b4c7b 100644
--- a/ui/component/or-smart-notify/package.json
+++ b/ui/component/or-smart-notify/package.json
@@ -2,7 +2,7 @@
"name": "@openremote/or-smart-notify",
"version": "1.0.0",
"description": "OpenRemote Smarty Notify element",
- "main": "dist/index.js",
+ "main": "src/index.js",
"types": "src/index.ts",
"scripts": {
"build": "npx tsc",
diff --git a/ui/component/or-timeline/package.json b/ui/component/or-timeline/package.json
index 7ccba7d32..cb163b4ac 100644
--- a/ui/component/or-timeline/package.json
+++ b/ui/component/or-timeline/package.json
@@ -2,7 +2,7 @@
"name": "@openremote/or-timeline",
"version": "1.0.0",
"description": "OpenRemote Timeline",
- "main": "dist/index.js",
+ "main": "src/index.js",
"types": "src/index.ts",
"scripts": {
"build": "npx tsc",