-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display parse errors on generic file workspaces
- Loading branch information
1 parent
9c87e6b
commit 35ed1ab
Showing
5 changed files
with
48 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
web-common/src/features/metrics-views/editor/MetricsEditorContainer.svelte
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 29 additions & 5 deletions
34
web-common/src/layout/workspace/WorkspaceEditorContainer.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
<div | ||
class="size-full flex-shrink-1 overflow-hidden border rounded-[2px]" | ||
style:min-height="150px" | ||
> | ||
<slot /> | ||
<script lang="ts"> | ||
import type { LineStatus } from "@rilldata/web-common/components/editor/line-status/state"; | ||
import CancelCircle from "@rilldata/web-common/components/icons/CancelCircle.svelte"; | ||
import { LIST_SLIDE_DURATION } from "@rilldata/web-common/layout/config"; | ||
import { slide } from "svelte/transition"; | ||
export let error: LineStatus | undefined = undefined; | ||
export let showError = true; | ||
</script> | ||
|
||
<div class="flex flex-col size-full gap-y-1"> | ||
<div | ||
class="size-full border overflow-y-hidden rounded-[2px] bg-background flex flex-col items-center justify-center" | ||
class:!border-red-500={error} | ||
> | ||
<slot /> | ||
</div> | ||
|
||
{#if error && showError} | ||
<div | ||
role="status" | ||
transition:slide={{ duration: LIST_SLIDE_DURATION }} | ||
class="editor-error ui-editor-text-error ui-editor-bg-error border border-red-500 border-l-4 px-2 py-5 max-h-72 overflow-auto" | ||
> | ||
<div class="flex gap-x-2 items-center"> | ||
<CancelCircle />{error.message} | ||
</div> | ||
</div> | ||
{/if} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters