Skip to content

Commit

Permalink
Make development status bar optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
joswarmer committed Nov 19, 2024
1 parent 9705f43 commit 3615661
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
7 changes: 4 additions & 3 deletions packages/webapp-lib/src/lib/FreonLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import { EditorState } from "./language/EditorState.js";
// import this file to set which loggers will be active
import { muteLogs } from "./logging/LoggerSettings.js";
import { inDevelopment } from "./logging/LoggerSettings.js";
import FreonContent from "./FreonContent.svelte";
import RenameUnitDialog from "./components/dialogs/file-dialogs/RenameUnitDialog.svelte";
import {WebappConfigurator} from "./WebappConfigurator.js";
Expand Down Expand Up @@ -116,7 +116,6 @@
comm.openModel(model);
$initializing = false;
}
</script>

<svelte:window on:beforeunload={onBeforeUnload} />
Expand Down Expand Up @@ -170,7 +169,9 @@
</TopAppBar>

<AutoAdjust {topAppBar} >
<StatusBar />
{#if inDevelopment}
<StatusBar />
{/if}
<LinearProgress indeterminate closed={!$editorProgressShown} />
<div class='main-frame'>
<Drawer variant='dismissible' bind:open={$drawerOpen}>
Expand Down
2 changes: 2 additions & 0 deletions packages/webapp-lib/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Reexport of all library components
import FreonLayout from "$lib/FreonLayout.svelte";
import { WebappConfigurator } from "./WebappConfigurator.js";
import { setDevelopment } from "$lib/logging/LoggerSettings.js";

export { FreonLayout };
export { WebappConfigurator };
export { setDevelopment }
6 changes: 6 additions & 0 deletions packages/webapp-lib/src/lib/logging/LoggerSettings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { FreLogger } from "@freon4dsl/core";

export let inDevelopment = false

export function setDevelopment(v: boolean): void {
inDevelopment = v;
}

// Mute or unmute logs here (in addition to elsewhere).
export function muteLogs() {
// from ~/core-svelte:
Expand Down
13 changes: 9 additions & 4 deletions packages/webapp-starter/src/starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {FreLogger, ServerCommunication} from "@freon4dsl/core";
* The one and only reference to the actual language for which this editor runs
*/
import {ExampleEnvironment} from "@freon4dsl/samples-example";
import { setDevelopment } from "@freon4dsl/webapp-lib";
WebappConfigurator.getInstance().setEditorEnvironment(ExampleEnvironment.getInstance());

/**
Expand All @@ -14,18 +15,22 @@ WebappConfigurator.getInstance().setEditorEnvironment(ExampleEnvironment.getInst
// WebappConfigurator.getInstance().setServerCommunication(LionWebRepositoryCommunication.getInstance());
WebappConfigurator.getInstance().setServerCommunication(ServerCommunication.getInstance());

setDevelopment(true)

/**
* Now start the app ...
*/
const app = new FreonLayout({
target: document.body,
});

// FreLogger.unmute("FreProjectionHandler")
// FreLogger.unmute("TextComponent")
// FreLogger.unmute("TextDropdownComponent")
// FreLogger.unmute("DropdownComponent")
FreLogger.unmute("ActionBox")
FreLogger.unmute("BehaviorUtils")
FreLogger.setFilter(["beforeUpdate", "afterUpdate", "onMount", "REFRESH", "refresh", "setting text to"])
// FreLogger.unmute("EditorState")
// FreLogger.unmute("InMemoryModel")
// FreLogger.unmute("TextComponent")
// FreLogger.unmute("ServerCommunication")
FreLogger.setFilter(["beforeUpdate", "setFocus", "afterUpdate", "onMount", "REFRESH", "refresh"])

export default app;

0 comments on commit 3615661

Please sign in to comment.