From 89432fef996db8bda80f3d6ecdd040de236b1afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ab=C3=A1sz?= <>
Date: Fri, 24 Mar 2023 21:35:21 +0100
Subject: [PATCH] Expose app configs to the metric tile factory
Make all settings available to the metric creator factory in order for
subcomponents (e.g DashboardAction) to use it without depending directly
on the global appState.
---
app/client/components/DashboardActions.js | 21 ++++++++++++-------
app/client/components/PerformanceDashboard.js | 4 ++--
app/client/store/dashboardMetrics.js | 20 +++++++++---------
3 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/app/client/components/DashboardActions.js b/app/client/components/DashboardActions.js
index e416917..e8aa034 100644
--- a/app/client/components/DashboardActions.js
+++ b/app/client/components/DashboardActions.js
@@ -6,7 +6,7 @@
*/
import { AppElement, html, css } from './AppElement.js'
-import { customElement, state } from 'lit/decorators.js'
+import { customElement, property, state } from 'lit/decorators.js'
import { icon_undo, icon_expand, icon_compress, icon_poweroff, icon_bluetooth, icon_upload, icon_heartbeat, icon_antplus } from '../lib/icons.js'
import './AppDialog.js'
@@ -74,6 +74,12 @@ export class DashboardActions extends AppElement {
}
`
+ @property({ type: Object })
+ config = {}
+
+ @property({ type: Object })
+ appMode = 'BROWSER'
+
@state()
_dialog
@@ -84,11 +90,11 @@ export class DashboardActions extends AppElement {
${this.renderOptionalButtons()}
@@ -104,7 +110,7 @@ export class DashboardActions extends AppElement {
// changing to fullscreen mode only makes sence when the app is openend in a regular
// webbrowser (kiosk and standalone mode are always in fullscreen view) and if the
// browser supports this feature
- if (this.appState?.appMode === 'BROWSER' && document.documentElement.requestFullscreen) {
+ if (this.appMode === 'BROWSER' && document.documentElement.requestFullscreen) {
buttons.push(html`