Skip to content

Commit

Permalink
Add spinner to waiting messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dokempf committed Jul 25, 2024
1 parent d8a36d1 commit 9b8f97f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/components/EasyDBDetailView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import { maskObj } from "../lib/easydbHelpers";
import { appLanguageStore, dataLanguagesStore, easydbInstanceStore, easydbInstanceDataPromiseStore, uuidStore } from "../lib/stores";
import AssetViewer from "./logic/AssetViewer.svelte";
import RecursiveEasyDbDetailView from "./logic/RecursiveEasyDBDetailView.svelte";
import { A } from "flowbite-svelte";
import { ArrowLeftOutline } from "flowbite-svelte-icons";
import AssetViewer from "./logic/AssetViewer.svelte";
import RecursiveEasyDbDetailView from "./logic/RecursiveEasyDBDetailView.svelte";
import Waiting from "./utils/Waiting.svelte";
export let uuid = "";
export let appLanguage = "de-DE";
export let dataLanguages = ["de-DE", "en-US"];
Expand All @@ -29,10 +31,14 @@
</script>

{#await $easydbInstanceDataPromiseStore }
Accessing the EasyDB instance...
<Waiting>
Accessing the EasyDB instance...
</Waiting>
{:then}
{#await easydb_api_object($uuidStore.at(-1), mask) }
Waiting for API response...
<Waiting>
Waiting for API response...
</Waiting>
{:then data }
{#if $uuidStore.length > 1}
<A on:click={() => { uuidStore.update((existing) => existing.slice(0, -1)); }}>
Expand Down
8 changes: 6 additions & 2 deletions src/components/logic/RecursiveEasyDBDetailView.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script>
import { fieldData, hasReverseSubData, hasSubData, linkedSubData, maskObj, reverseLinkedSubData, splitterTitle } from "../../lib/easydbHelpers";
import { easydb_api_object } from "../../lib/apiaccess";
import { Card, Li, List, P } from "flowbite-svelte";
import CustomSplitterDispatch from "./CustomSplitterDispatch.svelte";
Expand All @@ -13,7 +15,7 @@
import TabItem from "../splitter/TabItem.svelte";
import FieldLabel from "../fields/FieldLabel.svelte";
import NotImplemented from "../utils/NotImplemented.svelte";
import { easydb_api_object } from "../../lib/apiaccess";
import Waiting from "../utils/Waiting.svelte";
export let fields;
export let data;
Expand Down Expand Up @@ -165,7 +167,9 @@
{:else if firstField.inline === "text" }
<Card horizontal class="max-w-full block">
{#await loadAdditionalUUID(firstField)}
Loading...
<Waiting>
Accessing API...
</Waiting>
{:then additionalData}
<svelte:self fields={maskObj(additionalData).fields} data={additionalData} table={maskObj(additionalData).table_name_hint} condensed={condensed} output="text"/>
{/await}
Expand Down
14 changes: 14 additions & 0 deletions src/components/utils/Waiting.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script>
import { P, Spinner } from "flowbite-svelte";
</script>

<div class="easydb-waiting flex justify-center">
<div>
<P>
<Spinner class="h-12 w-12"/>
</P>
<P class="pt-4">
<slot />
</P>
</div>
</div>

0 comments on commit 9b8f97f

Please sign in to comment.