Fix className autocorrect and make client load time optional
This commit is contained in:
parent
e35fc7cb7b
commit
96150094b7
|
@ -82,10 +82,10 @@
|
||||||
id="spectrum-root"
|
id="spectrum-root"
|
||||||
lang="en"
|
lang="en"
|
||||||
dir="ltr"
|
dir="ltr"
|
||||||
className="spectrum spectrum--medium {$themeStore.theme}"
|
class="spectrum spectrum--medium {$themeStore.theme}"
|
||||||
>
|
>
|
||||||
{#if permissionError}
|
{#if permissionError}
|
||||||
<div className="error">
|
<div class="error">
|
||||||
<Layout justifyItems="center" gap="S">
|
<Layout justifyItems="center" gap="S">
|
||||||
{@html ErrorSVG}
|
{@html ErrorSVG}
|
||||||
<Heading size="L">You don't have permission to use this app</Heading>
|
<Heading size="L">You don't have permission to use this app</Heading>
|
||||||
|
|
|
@ -377,7 +377,7 @@
|
||||||
<!-- The ID is used as a class because getElementsByClassName is O(1) -->
|
<!-- The ID is used as a class because getElementsByClassName is O(1) -->
|
||||||
<!-- and the performance matters for the selection indicators -->
|
<!-- and the performance matters for the selection indicators -->
|
||||||
<div
|
<div
|
||||||
className={`component ${id}`}
|
class={`component ${id}`}
|
||||||
class:draggable
|
class:draggable
|
||||||
class:droppable
|
class:droppable
|
||||||
class:empty
|
class:empty
|
||||||
|
|
|
@ -65,8 +65,9 @@
|
||||||
flex: 0 0 50px;
|
flex: 0 0 50px;
|
||||||
grid-template-columns: 1fr auto;
|
grid-template-columns: 1fr auto;
|
||||||
}
|
}
|
||||||
.dev-preview-header
|
.dev-preview-header :global(.spectrum-Heading),
|
||||||
:global(.spectrum-Heading, .spectrum-Picker-menuIcon, .spectrum-Picker-label) {
|
.dev-preview-header :global(.spectrum-Picker-menuIcon),
|
||||||
|
.dev-preview-header :global(.spectrum-Picker-label) {
|
||||||
color: white !important;
|
color: white !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -8,10 +8,12 @@
|
||||||
<DevToolsStat label="App" value={$appStore.application?.name} />
|
<DevToolsStat label="App" value={$appStore.application?.name} />
|
||||||
<DevToolsStat label="Tenant" value={$appStore.application?.tenantId} />
|
<DevToolsStat label="Tenant" value={$appStore.application?.tenantId} />
|
||||||
<DevToolsStat label="Version" value={$appStore.application?.version} />
|
<DevToolsStat label="Version" value={$appStore.application?.version} />
|
||||||
|
{#if $appStore.clientLoadTime}
|
||||||
<DevToolsStat
|
<DevToolsStat
|
||||||
label="Client load time"
|
label="Client load time"
|
||||||
value={`${$appStore.clientLoadTime} ms`}
|
value={`${$appStore.clientLoadTime} ms`}
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
<DevToolsStat label="App layouts" value={$screenStore.layouts?.length || 0} />
|
<DevToolsStat label="App layouts" value={$screenStore.layouts?.length || 0} />
|
||||||
<DevToolsStat label="Active layout" value={$screenStore.activeLayout?.name} />
|
<DevToolsStat label="Active layout" value={$screenStore.activeLayout?.name} />
|
||||||
<DevToolsStat label="App screens" value={$screenStore.screens?.length || 0} />
|
<DevToolsStat label="App screens" value={$screenStore.screens?.length || 0} />
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { get, writable } from "svelte/store"
|
||||||
const initialState = {
|
const initialState = {
|
||||||
appId: null,
|
appId: null,
|
||||||
isDevApp: false,
|
isDevApp: false,
|
||||||
clientLoadTime: Date.now() - (window.INIT_TIME || Date.now()),
|
clientLoadTime: window.INIT_TIME ? Date.now() - window.INIT_TIME : null,
|
||||||
}
|
}
|
||||||
|
|
||||||
const createAppStore = () => {
|
const createAppStore = () => {
|
||||||
|
@ -19,6 +19,7 @@ const createAppStore = () => {
|
||||||
try {
|
try {
|
||||||
const appDefinition = await API.fetchAppPackage(appId)
|
const appDefinition = await API.fetchAppPackage(appId)
|
||||||
store.set({
|
store.set({
|
||||||
|
...initialState,
|
||||||
...appDefinition,
|
...appDefinition,
|
||||||
appId: appDefinition?.application?.appId,
|
appId: appDefinition?.application?.appId,
|
||||||
isDevApp: appId.startsWith("app_dev"),
|
isDevApp: appId.startsWith("app_dev"),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { localStorageStore } from "builder/src/builderStore/store/localStorage"
|
import { createLocalStorageStore } from "@budibase/frontend-core"
|
||||||
import { appStore } from "./app"
|
import { appStore } from "./app"
|
||||||
import { initialise } from "./initialise"
|
import { initialise } from "./initialise"
|
||||||
import { authStore } from "./auth"
|
import { authStore } from "./auth"
|
||||||
|
@ -12,7 +12,7 @@ const initialState = {
|
||||||
|
|
||||||
const createDevToolStore = () => {
|
const createDevToolStore = () => {
|
||||||
const localStorageKey = `${get(appStore).appId}.devTools`
|
const localStorageKey = `${get(appStore).appId}.devTools`
|
||||||
const store = localStorageStore(localStorageKey, initialState)
|
const store = createLocalStorageStore(localStorageKey, initialState)
|
||||||
|
|
||||||
const setVisible = visible => {
|
const setVisible = visible => {
|
||||||
store.update(state => ({
|
store.update(state => ({
|
||||||
|
|
Loading…
Reference in New Issue